We’ve put together a small addition to the
hasql ecosystem: hasql-listen-notify (GitHub source).
Users may be already familiar with hasql-notifications, the first library in the
hasql ecosystem to provide asynchronous notification support. So here are a few reasons you may consider switching:
- More “hasqly” API featuring
- No dependency on
- Safer identifier escaping that uses
PQescapeIdentifier()rather than a custom Haskell implementation.
- More minimal/fundamental
awaitcombinators for receiving notifications, rather than a monolithic
waitForNotificationsthat accepts a callback.
- Correct reconnection handling: it’s possible for a libpq connection object to be temporarily disconnected from Postgres, and this library will not throw an exception in this case.
- Backend PID from notification payload is not thrown away.
Thanks and don’t hesitate to file an issue or ask a question.