-
Hey everyone 👋 I'm currently building an endpoint to send server side events (SSE) to the client and what I have to do right now is something like
This has some overhead and drawbacks i.e. there are no transactions in prisma atm, so step 2 executes separate operations and of course I need to manage event emiters. A much better alternative to this would be to use prisma to subscribe to changes in a specific row inside that SSE endpoint and push new data when it is received. I looked at the docs, but wasn't able to find anything like this. So I guess my question is if its possible or maybe this is a good feature proposal? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hey @iljadaderko 👋 The workaround for now would be as you mentioned to use an Event Emitter or PubSub service at the application layer to handle subscriptions to the changes in the database. |
Beta Was this translation helpful? Give feedback.
-
So 4 years later, how is it going? still no subscribe to postgres events? |
Beta Was this translation helpful? Give feedback.
Hey @iljadaderko 👋
Yes indeed this is a good feature proposal and you can find it here. There is a main issue linked inside which provides the entire basis for Subscriptions and how they can be implemented. Do add a 👍 on the issue as well so that we can judge the priority of those issues.
The workaround for now would be as you mentioned to use an Event Emitter or PubSub service at the application layer to handle subscriptions to the changes in the database.