Open
Description
When using qm.OrIn
and passing in an empty array custom closing parentheses are being removed.
See this example code:
inIds1 := []interface{}{1, 2}
inIds2 := []interface{}{}
dao.Users(
qm.WhereIn("(id IN ?", inIds1...),
qm.OrIn("id in ?)", inIds2...),
).AllP(ctx, u.dbPool.MustGetConnection())
Resulting query (note the missing closing parenthesis after (1=0)
):
SELECT `users`.* FROM `users` WHERE ((id IN (?,?)) OR (1=0) AND (`users`.`deleted_at` is null);
Expected query:
SELECT `users`.* FROM `users` WHERE ((id IN (?,?)) OR (1=0)) AND (`users`.`deleted_at` is null);
What version of SQLBoiler are you using (sqlboiler --version
)?
SQLBoiler v4.14.2
What is your database and version (eg. Postgresql 10)
MariaDB 10.5.8
If this happened at generation time what was the full SQLBoiler command you used to generate your models? (if not applicable leave blank)
If this happened at runtime what code produced the issue? (if not applicable leave blank)
see above