databases
databases copied to clipboard
Async LISTEN/NOTIFY support?
Is it possible to listen for asynchronous PG notifications using this library? Is that functionality supported?
- https://www.postgresql.org/docs/9.1/sql-listen.html
- https://www.postgresql.org/docs/9.1/sql-notify.html
Yes, you have to use connection.raw_connection then call add_listener as per asyncpg docs: https://magicstack.github.io/asyncpg/current/api/index.html#asyncpg.connection.Connection.add_listener
Yep exactly we ended up dropping down to the asyncpg API.