Allow using PostgreSQL from Clojure as effortlessly as possible by reading connection parameter defaults from PostgreSQL environment variables PGDATABASE, PGHOST, PGPORT, PGUSER and by reading password from ~/.pgpass if available.
Allow using PostgreSQL from Clojure as effortlessly as possible by reading connection parameter defaults from PostgreSQL environment variables PGDATABASE, PGHOST, PGPORT, PGUSER and by reading password from ~/.pgpass if 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 was closeable and closed.
Close db-spec if possible. Return true if the datasource was closeable and closed.
(default-spec)Reasonable defaults as with the psql command line tool. Use username for user and db. Don't use host.
Reasonable defaults as with the psql command line tool. Use username for user and db. Don't use host.
(env-spec {:keys [PGDATABASE PGHOST PGPORT PGUSER] :as env})Get db spec by reading PG* variables from the environment.
Get db spec by reading PG* variables from the environment.
(getenv->map)(getenv->map env)Keywordize an environment-style map. With no argument, reads (System/getenv). Accepts any map-like input so callers can pass a plain map in tests.
Keywordize an environment-style map. With no argument, reads (System/getenv). Accepts any map-like input so 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. (pg/interval :hours 2)
Create a PGinterval. (pg/interval :hours 2)
(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
(object type value)Make a custom PGobject, e.g. (pg/object "json" "{}")
Make a custom PGobject, e.g. (pg/object "json" "{}")
(path obj)(path points open?)Create a PGpath object
Create a PGpath object
(polygon points-or-str)Create a PGpolygon object
Create a PGpolygon object
(spec & {:keys [password] :as opts})Create a database spec for PostgreSQL. Uses PG* environment variables by default and accepts overrides in the form: (spec :dbname ... :host ... :port ... :user ... :password ...)
The password is resolved with libpq-style precedence: an explicit :password option, then the PGPASSWORD environment variable, then a ~/.pgpass match.
Create a database spec for PostgreSQL. Uses PG* environment variables by default and accepts overrides in the form: (spec :dbname ... :host ... :port ... :user ... :password ...) The password is resolved with libpq-style precedence: an explicit :password option, then the PGPASSWORD environment variable, then a ~/.pgpass match.
(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.
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 |