Dynamic conditional raw query question
Hello there, Im trying to create a dynamic query like this:
But kysely is trying to do substitution where I have my TS logic to either add the WHERE clause or not. How can I fix this ?
3 Replies
Skip the questions of why im using a string query vs the query builder, this is a once off raw query to tables I don't have the schema for. 😆
Unknown User•7mo ago
Message Not Public
Sign In & Join Server To View
You can use
Kysely<any>
to write that query.
Just cast any db instance
But this also works
sql.raw
is not safe when there's user input involved.