Closed mdnorman closed 2 weeks ago
Ouch, thanks for opening the issue! We don't clear the OperationNodeVisitor.nodeStack
at the beginning of compilation. The stack is left behind from that interrupted compilation.
But that query shouldn't pass typescript checks. The type of the array is undefined[]
. Even if the type was (string | undefined)[]
Kysely wouldn't accept it. Are you using some extremely loose typescript settings? Strict mode is needed for Kysely types to function properly.
Yep, you're absolutely right about the types. This was a simple repro to demonstrate the problem, but in the real case, the undefined sneakily got in there from a much earlier part of the pipeline.
The following code will cause an error and then break the DB connection for further updates.
I confirmed that restarting the service and running the update call works fine because the generated SQL does not have the surrounding parentheses. I confirmed the presence of the parentheses with
query.compile().sql
.