Use PostgreSQL from Clojure with connection parameter defaults from PGDATABASE, PGHOST, PGPORT, and PGUSER. Read the password from ~/.pgpass when it is available.
Use PostgreSQL from Clojure with connection parameter defaults from PGDATABASE, PGHOST, PGPORT, and PGUSER. Read the password from ~/.pgpass when it is available.
(box obj)(box p1 p2)(box x1 y1 x2 y2)Create a PGbox object.
Create a PGbox object.
(circle obj)(circle center-point r)(circle x y r)Create a PGcircle object.
Create a PGcircle object.
(close! {:keys [datasource]})Close db-spec if possible. Return true if the datasource can close and is closed.
Close db-spec if possible. Return true if the datasource can close and is closed.
(default-spec)Set defaults like the psql command line tool. Use the username for the user and dbname. Do not set a host.
Set defaults like the psql command line tool. Use the username for the user and dbname. Do not set a host.
(env-spec {:keys [PGDATABASE PGHOST PGPORT PGUSER PGTARGETSESSIONATTRS]
:as env})Get a db spec from libpq PG* environment variables, using pgjdbc property
names where they differ. PGTZ and PGDATESTYLE are folded into the pgjdbc
options string (merged after any PGOPTIONS).
Not supported, because pgjdbc has no equivalent: PGHOSTADDR (no DNS-bypass
address; use PGHOST), PGCLIENTENCODING (pgjdbc always speaks UTF-8),
PGREQUIREPEER, PGSSLSNI, PGSSLCRL, the SSL min/max protocol vars, and
Unix-domain sockets (pgjdbc needs a custom socket factory).
Get a db spec from libpq PG* environment variables, using pgjdbc property names where they differ. `PGTZ` and `PGDATESTYLE` are folded into the pgjdbc `options` string (merged after any `PGOPTIONS`). Not supported, because pgjdbc has no equivalent: `PGHOSTADDR` (no DNS-bypass address; use `PGHOST`), `PGCLIENTENCODING` (pgjdbc always speaks UTF-8), `PGREQUIREPEER`, `PGSSLSNI`, `PGSSLCRL`, the SSL min/max protocol vars, and Unix-domain sockets (pgjdbc needs a custom socket factory).
(getenv->map)(getenv->map env)Keywordize an environment-style map. With no argument, read (System/getenv). Accept any map-like input. Callers can pass a plain map in tests.
Keywordize an environment-style map. With no argument, read (System/getenv). Accept any map-like input. Callers can pass a plain map in tests.
(interval &
{:keys [years months days hours minutes seconds]
:or {years 0 months 0 days 0 hours 0 minutes 0 seconds 0.0}})Create a PGinterval. Example: (pg/interval :hours 2)
Create a PGinterval. Example: (pg/interval :hours 2)
(jsonpath s)Create a PostgreSQL jsonpath value.
Create a PostgreSQL `jsonpath` value.
(line obj)(line p1 p2)(line x1 y1 x2 y2)Create a PGline object.
Create a PGline object.
(lseg obj)(lseg p1 p2)(lseg x1 y1 x2 y2)Create a PGlseg object.
Create a PGlseg object.
(macaddr s)Create a PostgreSQL macaddr (6-byte MAC address) value.
Create a PostgreSQL `macaddr` (6-byte MAC address) value.
(macaddr8 s)Create a PostgreSQL macaddr8 (8-byte EUI-64 MAC address) value.
Create a PostgreSQL `macaddr8` (8-byte EUI-64 MAC address) value.
(object type value)Create a custom PGobject. Example: (pg/object "json" "{}")
Create a custom PGobject. Example: (pg/object "json" "{}")
(path obj)(path points open?)Create a PGpath object.
Create a PGpath object.
(pg-lsn s)Create a PostgreSQL pg_lsn (log sequence number) value.
Create a PostgreSQL `pg_lsn` (log sequence number) value.
(polygon points-or-str)Create a PGpolygon object.
Create a PGpolygon object.
(spec & {:keys [password service env] :as opts})Create a PostgreSQL database spec with libpq-style layers. Explicit options override a :service/PGSERVICE definition. The service definition overrides ordinary PG* environment values. Environment values override built-in defaults. Accept overrides: (spec :dbname ... :host ... :port ... :user ... :password ...)
Password precedence uses the same layers, then uses ~/.pgpass. Pass :env with a plain environment map for repeatable tests.
Create a PostgreSQL database spec with libpq-style layers. Explicit options override a :service/PGSERVICE definition. The service definition overrides ordinary PG* environment values. Environment values override built-in defaults. Accept overrides: (spec :dbname ... :host ... :port ... :user ... :password ...) Password precedence uses the same layers, then uses ~/.pgpass. Pass :env with a plain environment map for repeatable tests.
(tables db)Return the set of table names (as keywords) visible in the database DB.
Return the set of table names (as keywords) visible in the database DB.
(tsquery s)Create a PostgreSQL tsquery (full-text query) value.
Create a PostgreSQL `tsquery` (full-text query) value.
(tsvector s)Create a PostgreSQL tsvector (full-text document) value.
Create a PostgreSQL `tsvector` (full-text document) value.
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 |