-
-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NOTIFY/LISTEN #97
Comments
After some more reading on this subject, I discovered https://github.com/GraphQLCollege/graphql-postgres-subscriptions which uses a neat little package called pg-ipc under the hood: https://github.com/emilbayes/pg-ipc Also, an interesting discussion around the convention of using AsyncIterator for this kind of thing: apollographql/graphql-subscriptions#116 My ideal feature request would be for slonik to expose an This could be an interceptor and live in its own package(s), but AFAICS a change would still need to be made to this package to pass the 'raw' pg client as a parameter to an interceptor. I'd be happy to work on a PR for this if you like the sound of it. |
This module might also be of interest, in case you haven't heard about it: |
I think that this is conceptually quite different from what the rest of the library is used (persistent subscriptions VS isolated transactions). I don't see anything wrong with pg-listen being used in addition to Slonik, without merging the former into the latter. Please use 👍 on the OPs issue if you would like this feature. I am keeping an eye on the most upvoted issues. I will re-open the issue if there is meaningful demand. |
@gajus look like this feature request got quite a few upvotes :) I would second that it would be great to have such support in slonik! Source code of |
Open to exploring it, but since I don't have active use case, it isn't something that I plan to own. |
Unfortunately I am not too confident with slonik's internals to contribute but perhaps these findings would help someone: The way
Since slonik is (at least so far) based on
Initially I thought that it would be possible to use
Since |
Is there a way to access the
notification
event from node-postgres client via slonik?I'd like to send messages via WebSocket using this event and
pg_notify
, similar to this article:https://medium.com/@simon.white/postgres-publish-subscribe-with-nodejs-996a7e45f88
Thanks for an awesome Postgres client!
The text was updated successfully, but these errors were encountered: