Reuben Porter
10/07/2021, 1:03 PMprisma.$queryRaw and using sql ORDER BY. I am passing in the order by and direction values as parameters, however the query is not working
e.g.
ORDER BY ${orderBy} ${direction}
should become
ORDER BY name ASC
Don't suppose anyone has any ideas? Before I've used pg promise :raw but not sure how to do this the 'prisma way'.
Apologies if anything isn't clear.Ryan
10/07/2021, 1:08 PM$queryRaw for passing in columns and keywords. You need to use $queryRawUnsafe for this and sanitise your inputs.Reuben Porter
10/07/2021, 1:10 PMReuben Porter
10/07/2021, 1:13 PMReuben Porter
10/07/2021, 1:14 PMRyan
10/07/2021, 1:14 PMRyan
10/07/2021, 1:15 PMReuben Porter
10/07/2021, 1:17 PM