Saif
Saif
KKysely
Created by Saif on 2/26/2024 in #help
How to use kysely in edge runtime (like NextJS 14 middleware)?
Error: The edge runtime does not support Node.js 'crypto' module. Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime Full log: https://pastebin.com/JSXBNRxv I need to verify if the user has access to the resources they are trying to visit, the middleware seemed to be the best place for this. However, I am not able to query the database as it is throwing the above error.
7 replies
KKysely
Created by Saif on 2/14/2024 in #help
Is there a way to handle migrations with .sql files?
No description
5 replies
KKysely
Created by Saif on 2/14/2024 in #help
Postgres: Transaction not honouring previous queries
Hi, I have a table with unique constraint on some columns. In a transaction, I am deleting all the entries from the table and then I am inserting new entries. However, I am getting error: duplicate key value violates unique constraint "xxxxx_key" I only want the deletion to happen if the insertion is successful, and that's why I tried using transaction. However, the transaction seems to work in a different way than I thought. Can someone help me in understanding this behaviour and what's the solution to this?
7 replies
KKysely
Created by Saif on 2/12/2024 in #help
Webstorm warning with multiple joins
No description
4 replies