Liking cljdoc? Tell your friends :D
Clojure only.

pgmalli.impl.ir

Reads the structure of one schema from pg_catalog through psql.

Connection settings are psql's own (PGHOST, PGPORT, PGDATABASE, PGUSER, PGPASSWORD, PGSSLMODE, ~/.pgpass); entries in the db map override them for the call.

Result shape: {:name "public" :database_version "PostgreSQL 17.6" :tables {"users" {:name "users" :columns [{:name :position :data_type :type_schema :is_nullable :default_value :generated_expr :identity :max_length :precision :scale}] :constraints {"users_age_check" {:name :type :columns :check_clause :is_valid :nulls_not_distinct :references}}}} :types {"mood" {:kind "ENUM" :enum_values [...]} "email" {:kind "DOMAIN" :base_type :not_null :default :constraints [{:name :definition}]}}} :type is one of "CHECK", "PRIMARY KEY", "UNIQUE", "FOREIGN KEY"; :references is {:match :schema :table :columns} for foreign keys, :match one of "SIMPLE", "FULL", "PARTIAL"; :nulls_not_distinct is set for UNIQUE constraints. Maps keyed by object name (:tables, :constraints, :types) keep string keys; everything else is keywordized. Expressions are the strings PostgreSQL's deparser produces.

Reads the structure of one schema from pg_catalog through psql.

Connection settings are psql's own (PGHOST, PGPORT, PGDATABASE, PGUSER, PGPASSWORD,
PGSSLMODE, ~/.pgpass); entries in the db map override them for the call.

Result shape:
  {:name "public" :database_version "PostgreSQL 17.6"
   :tables {"users" {:name "users"
                     :columns [{:name :position :data_type :type_schema :is_nullable
                                :default_value :generated_expr :identity :max_length :precision :scale}]
                     :constraints {"users_age_check" {:name :type :columns :check_clause :is_valid :nulls_not_distinct :references}}}}
   :types {"mood" {:kind "ENUM" :enum_values [...]}
           "email" {:kind "DOMAIN" :base_type :not_null :default :constraints [{:name :definition}]}}}
:type is one of "CHECK", "PRIMARY KEY", "UNIQUE", "FOREIGN KEY"; :references is
{:match :schema :table :columns} for foreign keys, :match one of "SIMPLE", "FULL", "PARTIAL";
:nulls_not_distinct is set for UNIQUE constraints. Maps keyed by object name (:tables, :constraints,
:types) keep string keys; everything else is keywordized. Expressions are the strings
PostgreSQL's deparser produces.
raw docstring

from-dbclj

(from-db)
(from-db {:keys [schema psql dir] :or {schema "public" psql "psql"} :as db})

Structure of the schema named by :schema (default "public"). :psql selects the binary.

Structure of the schema named by :schema (default "public"). :psql selects the binary.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close