prisma sync and async api As you all know prisma ...
# orm-help
k
prisma sync and async api As you all know prisma returns Promise but I wanna to have the ability to tell prisma that this query should be executed synchronous not asynchronous. Any thought?
👀 1
j
I think prisma should be async because this is the nature of nodejs
k
I know But sometimes we need to perform sync operations. That's why we have
readFileSync
in the nodejs file system module.
@Jarupong Pajakgo
j
Could you explain more why do you need prisma works in synchronous way?
it will block others request from the client even though nodejs has UV thread.
n
Is your use case like you want to execute only one database request at a time?
k
Because I have a sync function which needs some data from database and I need to keep the function sync to return data @Jarupong Pajakgo
j
Is it possible to use
async/await
for your function?
k
Nope as I said It has to be sync Completely synchronous
@Nurul No In one place I need to exucute a get query agains my DB in sync style Not promise (nor async/await, nor then/catch) Just pure sync