We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
not sure if this is expected?
https://go.dev/play/p/yMEuRKDSOSI
package main import ( "fmt" sq "github.com/Masterminds/squirrel" ) func getFilter() sq.Or { return nil } func main() { users := sq.Select("*").From("users").Where(getFilter()) sql, _, err := users.ToSql() if err != nil { panic(err) } fmt.Println(sql) }
=> SELECT * FROM users WHERE (1=0)
SELECT * FROM users WHERE (1=0)
IMHO this is really tricky and error-prone
The text was updated successfully, but these errors were encountered:
Workaround: return sq.Sqlizer instead of sq.Or https://go.dev/play/p/l0fZoUdUxXA
sq.Sqlizer
sq.Or
func getFilter() sq.Sqlizer { return nil }
=> SELECT * FROM users
SELECT * FROM users
Sorry, something went wrong.
No branches or pull requests
Hello,
not sure if this is expected?
https://go.dev/play/p/yMEuRKDSOSI
=>
SELECT * FROM users WHERE (1=0)
IMHO this is really tricky and error-prone
The text was updated successfully, but these errors were encountered: