@@ -103,6 +103,14 @@ module SQL {
103
103
/** A string that might identify package `go-pg/pg/orm` or a specific version of it. */
104
104
private string gopgorm ( ) { result = package ( "github.com/go-pg/pg" , "orm" ) }
105
105
106
+ /** A string that might identify package `github.com/rqlite/gorqlite` or `github.com/raindog308/gorqlite` or a specific version of it. */
107
+ private string gorqlite ( ) {
108
+ result = package ( [ "github.com/rqlite/gorqlite" , "github.com/raindog308/gorqlite" ] , "" )
109
+ }
110
+
111
+ /** A string that might identify package `github.com/gogf/gf/database/gdb` or a specific version of it. */
112
+ private string gogf ( ) { result = package ( "github.com/gogf/gf" , "database/gdb" ) }
113
+
106
114
/**
107
115
* A string argument to an API of `go-pg/pg` that is directly interpreted as SQL without
108
116
* taking syntactic structure into account.
@@ -152,6 +160,65 @@ module SQL {
152
160
}
153
161
}
154
162
163
+ /**
164
+ * A string argument to an API of `github.com/rqlite/gorqlite`, or a specific version of it, that is directly interpreted as SQL without
165
+ * taking syntactic structure into account.
166
+ */
167
+ private class GorqliteQueryString extends Range {
168
+ GorqliteQueryString ( ) {
169
+ // func (conn *Connection) Query(sqlStatements []string) (results []QueryResult, err error)
170
+ // func (conn *Connection) QueryOne(sqlStatement string) (qr QueryResult, err error)
171
+ // func (conn *Connection) Queue(sqlStatements []string) (seq int64, err error)
172
+ // func (conn *Connection) QueueOne(sqlStatement string) (seq int64, err error)
173
+ // func (conn *Connection) Write(sqlStatements []string) (results []WriteResult, err error)
174
+ // func (conn *Connection) WriteOne(sqlStatement string) (wr WriteResult, err error)
175
+ exists ( Method m , string name | m .hasQualifiedName ( gorqlite ( ) , "Connection" , name ) |
176
+ name = [ "Query" , "QueryOne" , "Queue" , "QueueOne" , "Write" , "WriteOne" ] and
177
+ this = m .getACall ( ) .getArgument ( 0 )
178
+ )
179
+ }
180
+ }
181
+
182
+ /**
183
+ * A string argument to an API of `github.com/gogf/gf/database/gdb`, or a specific version of it, that is directly interpreted as SQL without
184
+ * taking syntactic structure into account.
185
+ */
186
+ private class GogfQueryString extends Range {
187
+ GogfQueryString ( ) {
188
+ exists ( Method m , string name | m .implements ( gogf ( ) , [ "DB" , "Core" , "TX" ] , name ) |
189
+ // func (c *Core) Exec(sql string, args ...interface{}) (result sql.Result, err error)
190
+ // func (c *Core) GetAll(sql string, args ...interface{}) (Result, error)
191
+ // func (c *Core) GetArray(sql string, args ...interface{}) ([]Value, error)
192
+ // func (c *Core) GetCount(sql string, args ...interface{}) (int, error)
193
+ // func (c *Core) GetOne(sql string, args ...interface{}) (Record, error)
194
+ // func (c *Core) GetValue(sql string, args ...interface{}) (Value, error)
195
+ // func (c *Core) Prepare(sql string, execOnMaster ...bool) (*Stmt, error)
196
+ // func (c *Core) Query(sql string, args ...interface{}) (rows *sql.Rows, err error)
197
+ // func (c *Core) Raw(rawSql string, args ...interface{}) *Model
198
+ name =
199
+ [
200
+ "Query" , "Exec" , "Prepare" , "GetAll" , "GetOne" , "GetValue" , "GetArray" , "GetCount" ,
201
+ "Raw"
202
+ ] and
203
+ this = m .getACall ( ) .getArgument ( 0 )
204
+ or
205
+ // func (c *Core) GetScan(pointer interface{}, sql string, args ...interface{}) error
206
+ // func (c *Core) GetStruct(pointer interface{}, sql string, args ...interface{}) error
207
+ // func (c *Core) GetStructs(pointer interface{}, sql string, args ...interface{}) error
208
+ name = [ "GetScan" , "GetStruct" , "GetStructs" ] and
209
+ this = m .getACall ( ) .getArgument ( 1 )
210
+ or
211
+ // func (c *Core) DoCommit(ctx context.Context, link Link, sql string, args []interface{}) (newSql string, newArgs []interface{}, err error)
212
+ // func (c *Core) DoExec(ctx context.Context, link Link, sql string, args ...interface{}) (result sql.Result, err error)
213
+ // func (c *Core) DoGetAll(ctx context.Context, link Link, sql string, args ...interface{}) (result Result, err error)
214
+ // func (c *Core) DoPrepare(ctx context.Context, link Link, sql string) (*Stmt, error)
215
+ // func (c *Core) DoQuery(ctx context.Context, link Link, sql string, args ...interface{}) (rows *sql.Rows, err error)
216
+ name = [ "DoGetAll" , "DoQuery" , "DoExec" , "DoCommit" , "DoPrepare" ] and
217
+ this = m .getACall ( ) .getArgument ( 2 )
218
+ )
219
+ }
220
+ }
221
+
155
222
/** A taint model for various methods on the struct `Formatter` of `go-pg/pg/orm`. */
156
223
private class PgOrmFormatterFunction extends TaintTracking:: FunctionModel , Method {
157
224
FunctionInput i ;
0 commit comments