PostgreSQL connection management utilities.
PostgreSQL connection management utilities.
(build-jdbc-url {:keys [host port name application-name statement-timeout-ms]})Build PostgreSQL JDBC URL from configuration.
Session settings ride on the URL so every physical connection in the pool gets them (unlike SET statements, which only affect one connection):
Args: db-config: Database configuration map with :host, :port, :name and optional :application-name, :statement-timeout-ms
Returns: String - JDBC URL with PostgreSQL-specific parameters
Build PostgreSQL JDBC URL from configuration.
Session settings ride on the URL so every physical connection in the pool
gets them (unlike SET statements, which only affect one connection):
- ApplicationName: connection identification in pg_stat_activity
- options: statement_timeout guard + UTC timezone
- reWriteBatchedInserts: batches multi-row INSERTs into single statements
Args:
db-config: Database configuration map with :host, :port, :name and
optional :application-name, :statement-timeout-ms
Returns:
String - JDBC URL with PostgreSQL-specific parameters(initialize! datasource _db-config)Verify PostgreSQL connectivity after pool creation.
Session settings (application_name, timezone, statement_timeout) are applied per-connection via JDBC URL properties in build-jdbc-url — a SET here would only reach the single pooled connection that happens to execute it.
Args: datasource: PostgreSQL datasource db-config: Database configuration map
Returns: nil - side effects only
Verify PostgreSQL connectivity after pool creation. Session settings (application_name, timezone, statement_timeout) are applied per-connection via JDBC URL properties in build-jdbc-url — a SET here would only reach the single pooled connection that happens to execute it. Args: datasource: PostgreSQL datasource db-config: Database configuration map Returns: nil - side effects only
(pool-defaults)Get PostgreSQL-optimized connection pool defaults.
Returns: Map - HikariCP pool configuration
Get PostgreSQL-optimized connection pool defaults. Returns: Map - HikariCP pool configuration
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 |