Getting syntax error when using the sql operator (pg)
Trying to execute this line of code:
the query that is produced by drizzle:
and getting this error:
No idea why, any insight would be appreciated!
4 Replies
Is this correct pg syntax? Are you attempting to Update a table?
Hi, thanks for the reply! Yes it is. It runs in the db just fine. Also works with sql.raw() but that would introduce a security flaw. This sets a temporary variable in the database and is later accessed using
for row level security
I guess it postgres doesn't support params in that sql statement, has to be hardcoded?
You could do
That would basically bypass sql inyection countermeasures
Great, I'll try that. Thanks for your help!