PostgreSQL LISTEN/NOTIFY helpers that use pgjdbc.
Use a dedicated open connection for listening. pgjdbc surfaces notifications only when a query is sent or get-notifications is called. A blocking poll prevents other statements from using the connection until the poll returns.
PostgreSQL LISTEN/NOTIFY helpers that use pgjdbc. Use a dedicated open connection for listening. pgjdbc surfaces notifications only when a query is sent or get-notifications is called. A blocking poll prevents other statements from using the 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 can block all other statements on this connection. Use a dedicated connection. A zero timeout does 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 can block all other statements on this connection. Use a
dedicated connection. A zero timeout does a non-blocking poll.(listen! conn channel)LISTEN on a channel with a dedicated open connection.
The caller owns the connection lifecycle.
LISTEN on a channel with 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 a payload on a channel with an open connection.
The channel is validated as an identifier and the payload is escaped by pgjdbc. Payloads are never logged.
Send a payload on a channel with 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 a channel on an open connection.
The caller owns the connection lifecycle.
UNLISTEN from a 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 |