You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
import (
"fmt"
"github.com/doug-martin/goqu/v9"
_ "github.com/doug-martin/goqu/v9/dialect/postgres"
)
func main() {
db := goqu.Dialect("postgres")
var val *int
query, _, _ := db.From(goqu.T("table")).Where(goqu.Ex{"explicit_nil": nil, "implicit_nil": val}).ToSQL()
fmt.Println(query) // SELECT * FROM "table" WHERE (("explicit_nil" IS NULL) AND ("implicit_nil" = NULL))
}
Expected behaviour
When using goqu.Ex in a while condition, I expect to get ...WHERE ("field" IS NULL)... and not ...WHERE ("field" = NULL)..., regardless if I use an implicit, or explicit nil value.
Dialect:
postgres
mysql
sqlite3
The text was updated successfully, but these errors were encountered:
Describe the bug
Select statement has invalid NULL check syntax when using goqu.Ex as where statement with implicit nil value (nil pointer).
To Reproduce
https://play.golang.org/p/X9YaafCJmn-
Expected behaviour
When using goqu.Ex in a while condition, I expect to get
...WHERE ("field" IS NULL)...
and not...WHERE ("field" = NULL)...
, regardless if I use an implicit, or explicit nil value.Dialect:
The text was updated successfully, but these errors were encountered: