PostgreSQL LISTEN/NOTIFY helpers backed directly by pgjdbc.
Use a dedicated open connection for listening. pgjdbc surfaces notifications only when a query is issued or get-notifications is called. A blocking poll prevents other statements from using that connection until the poll returns.
PostgreSQL LISTEN/NOTIFY helpers backed directly by pgjdbc. Use a dedicated open connection for listening. pgjdbc surfaces notifications only when a query is issued or get-notifications is called. A blocking poll prevents other statements from using that connection until the poll returns.
(get-notifications conn)(get-notifications conn timeout-millis)Poll an open PostgreSQL connection for notifications.
Returns a vector of {:name :parameter :pid} maps, or an empty vector. A positive timeout may block all other statements on this connection, so use a dedicated connection. A zero timeout performs a non-blocking poll.
Poll an open PostgreSQL connection for notifications.
Returns a vector of {:name :parameter :pid} maps, or an empty vector. A
positive timeout may block all other statements on this connection, so use a
dedicated connection. A zero timeout performs a non-blocking poll.(listen! conn channel)LISTEN on channel using a dedicated open connection.
The caller owns the connection lifecycle.
LISTEN on channel using a dedicated open connection. The caller owns the connection lifecycle.
(notification->map notification)Convert a pgjdbc notification to a Clojure map.
Convert a pgjdbc notification to a Clojure map.
(notify! conn channel payload)Send payload on channel using an open connection.
The channel is validated as an identifier and the payload is escaped by pgjdbc. Payloads are never logged.
Send payload on channel using an open connection. The channel is validated as an identifier and the payload is escaped by pgjdbc. Payloads are never logged.
(quote-channel channel)Validate and quote a channel name as a PostgreSQL identifier.
Channel names are restricted to portable ASCII identifier characters to make SQL interpolation secure by default.
Validate and quote a channel name as a PostgreSQL identifier. Channel names are restricted to portable ASCII identifier characters to make SQL interpolation secure by default.
(unlisten! conn channel)UNLISTEN from channel on an open connection.
The caller owns the connection lifecycle.
UNLISTEN from channel on an open connection. The caller owns the connection lifecycle.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |