Operational controls exposed by pgjdbc's PGConnection and the JDBC
connection: the backend process id, query cancellation, server parameter
statuses, the default fetch size, the transaction autosave mode, and a helper
to set the per-session statement timeout.
Each function accepts a java.sql.Connection (the value next.jdbc hands you
inside with-open/on-connection) and unwraps the pgjdbc PGConnection as
needed.
Operational controls exposed by pgjdbc's `PGConnection` and the JDBC connection: the backend process id, query cancellation, server parameter statuses, the default fetch size, the transaction autosave mode, and a helper to set the per-session statement timeout. Each function accepts a `java.sql.Connection` (the value `next.jdbc` hands you inside `with-open`/`on-connection`) and unwraps the pgjdbc `PGConnection` as needed.
(autosave conn)Return the transaction autosave mode of CONN as a keyword:
:never, :always, or :conservative.
Return the transaction autosave mode of CONN as a keyword: `:never`, `:always`, or `:conservative`.
(backend-pid conn)Return the server-side backend process id for CONN. Useful for correlating
with pg_stat_activity and for out-of-band cancellation.
Return the server-side backend process id for CONN. Useful for correlating with `pg_stat_activity` and for out-of-band cancellation.
(cancel-query! conn)Cancel the statement currently executing on CONN, if any. Safe to call from another thread than the one running the query.
Cancel the statement currently executing on CONN, if any. Safe to call from another thread than the one running the query.
(default-fetch-size conn)Return the default fetch size applied to statements created from CONN.
Return the default fetch size applied to statements created from CONN.
(escape-identifier conn s)Quote S as a PostgreSQL identifier using the server's own rules, for safe interpolation of dynamic table/column names.
Quote S as a PostgreSQL identifier using the server's own rules, for safe interpolation of dynamic table/column names.
(parameter-status conn name)Return the server's reported value for parameter NAME (for example "server_version" or "TimeZone"), or nil if it is unknown.
Return the server's reported value for parameter NAME (for example "server_version" or "TimeZone"), or nil if it is unknown.
(parameter-statuses conn)Return all server parameter statuses reported for CONN as a Clojure map of string name to string value.
Return all server parameter statuses reported for CONN as a Clojure map of string name to string value.
(set-autosave! conn mode)Set the transaction autosave mode of CONN. MODE is :never, :always, or
:conservative (pgjdbc places a savepoint before each statement so a failed
statement need not poison the whole transaction).
Set the transaction autosave mode of CONN. MODE is `:never`, `:always`, or `:conservative` (pgjdbc places a savepoint before each statement so a failed statement need not poison the whole transaction).
(set-default-fetch-size! conn n)Set the default fetch size for statements created from CONN. A positive value makes result sets stream in batches instead of materializing fully.
Set the default fetch size for statements created from CONN. A positive value makes result sets stream in batches instead of materializing fully.
(statement-timeout! conn ms)Set statement_timeout for the current session on CONN to MS milliseconds
(0 disables it). Later statements that run longer are cancelled by the server.
Set `statement_timeout` for the current session on CONN to MS milliseconds (0 disables it). Later statements that run longer are cancelled by the server.
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 |