Open Evan-Prophet opened 1 week ago
1.26.0
When using NOT IN & SQLite, if you pass it an empty slice, it will never match. This is because of:
query = strings.Replace(query, "/*SLICE:userIDs*/?", "NULL", 1)
The replacement to NULL will never be true.
NULL
E.g.:
# No Results select "example" as example WHERE example NOT IN (NULL); # Results select "example" as example WHERE example NOT IN ();
No response
https://play.sqlc.dev/p/1e688f1a8a0033e2e2bbbc3c0621e541cd11ef25a8ccd20aedcdd36d918892fa
macOS
SQLite
Go
Version
1.26.0
What happened?
When using NOT IN & SQLite, if you pass it an empty slice, it will never match. This is because of:
The replacement to
NULL
will never be true.E.g.:
Relevant log output
No response
Database schema
No response
SQL queries
No response
Configuration
No response
Playground URL
https://play.sqlc.dev/p/1e688f1a8a0033e2e2bbbc3c0621e541cd11ef25a8ccd20aedcdd36d918892fa
What operating system are you using?
macOS
What database engines are you using?
SQLite
What type of code are you generating?
Go