Syntax error when empty array is passed to a WHERE filter (request for more readable errors)
In a query like
someQuery.where("x", "in", xs)
, if xs
is empty, then the error will be something like error: syntax error at or near ")"
. Given that in complex queries there can be multiple places that could cause such an issue, debugging it is sometimes painful.
I understand that it's SQL that is throwing the error and empty arrays are not possible, but would it be feasible to do a runtime check by the lib and throw a more readable error in case that happens? Or would this be against the philsophy of Kysely or too much overhead?
Also, I think a fallback of 1=0
might make even more sense, since that should be the logical output of the query with an empty array.1.4KMembers
View on DiscordWant results from more Discord servers?
More PostsDerived tables for PostgresHi, I am trying to do a bulk update like this:
```
UPDATE your_table
SET someColumn = new_values.newComplex Query Builder from dynamic input - Typescript issueHi, it's me - again 🙂
I'm currently trying to migrate our current query builder.
It seems that eHow to add table/column comments when creating tables?Hey, we're approaching close to 100 tables in our project. New people will be joining our founding tNeed help improving a custom helperMy dopamine with Kysely is quite high right now, so I am experimenting all sorts of things to create