mirror of
https://github.com/github/codeql.git
synced 2026-01-30 06:42:57 +01:00
Add Where method of squirrel sql builders to query range
This commit is contained in:
@@ -88,10 +88,11 @@ module SQL {
|
||||
// first argument to `squirrel.Expr`
|
||||
fn.hasQualifiedName(sq, "Expr")
|
||||
or
|
||||
// first argument to the `Prefix` or `Suffix` method of one of the `*Builder` classes
|
||||
// first argument to the `Prefix`, `Suffix` or `Where` method of one of the `*Builder` classes
|
||||
exists(string builder | builder.matches("%Builder") |
|
||||
fn.(Method).hasQualifiedName(sq, builder, "Prefix") or
|
||||
fn.(Method).hasQualifiedName(sq, builder, "Suffix")
|
||||
fn.(Method).hasQualifiedName(sq, builder, "Suffix") or
|
||||
fn.(Method).hasQualifiedName(sq, builder, "Where")
|
||||
)
|
||||
) and
|
||||
this = fn.getACall().getArgument(0) and
|
||||
|
||||
@@ -44,6 +44,7 @@ func test(db *sql.DB, ctx context.Context) {
|
||||
|
||||
func squirrelTest(querypart string) {
|
||||
squirrel.Select("*").From("users").Where(squirrel.Expr(querypart)) // $ querystring=querypart
|
||||
squirrel.Select("*").From("users").Where(querypart) // $ querystring=querypart
|
||||
squirrel.Select("*").From("users").Suffix(querypart) // $ querystring=querypart
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user