Liking cljdoc? Tell your friends :D

pgmalli.core

The application side of pgmalli: the schemas generated from a PostgreSQL schema (files on the classpath as pgmalli/<schema>.edn), read and used. Generation and freshness, which need psql, are pgmalli.generate; datasets, which need test.check, pgmalli.data; HoneySQL queries checked and typed, pgmalli.honeysql.

The config (pgmalli.generate) and the generated file layout are the stable contract, and so is the fact vocabulary (pgmalli.impl.pattern), which is the one exception to the rule that pgmalli.impl.* may change without notice.

The application side of pgmalli: the schemas generated from a PostgreSQL schema (files on
the classpath as pgmalli/<schema>.edn), read and used. Generation and freshness, which need
psql, are pgmalli.generate; datasets, which need test.check, pgmalli.data; HoneySQL queries
checked and typed, pgmalli.honeysql.

The config (pgmalli.generate) and the generated file layout are the stable contract, and so
is the fact vocabulary (pgmalli.impl.pattern), which is the one exception to the rule that
pgmalli.impl.* may change without notice.
raw docstring

as-readclj

(as-read registry name)
(as-read registry name opts)

The [:map ...] of a row as a JDBC result builder returns it. Options, the ones pgmalli.honeysql takes too (read-options gives them for a next.jdbc builder): :qualified? (keys as :table/column, next.jdbc's as-maps), :kebab? (keys and table names in kebab-case), :nil-columns :absent (NULL columns missing, next.jdbc.optional), :time :instant (next.jdbc.date-time/read-as-instant: timestamps as Instants, dates stay java.sql.Date, so inst?) or :local (read-as-local: timestamptz as LocalDateTime); without :time every date and timestamp is inst?, which malli's default registry reads.

The [:map ...] of a row as a JDBC result builder returns it. Options, the ones
pgmalli.honeysql takes too (read-options gives them for a next.jdbc builder): :qualified?
(keys as :table/column, next.jdbc's as-maps), :kebab? (keys and table names in kebab-case),
:nil-columns :absent (NULL columns missing, next.jdbc.optional), :time :instant
(next.jdbc.date-time/read-as-instant: timestamps as Instants, dates stay java.sql.Date, so
inst?) or :local (read-as-local: timestamptz as LocalDateTime); without :time every date and
timestamp is inst?, which malli's default registry reads.
sourceraw docstring

columnclj

(column registry name col)

The schema of one column of a row or insert schema, as data, [:maybe ...] included; nil for a column the schema does not have. A name the registry does not hold is an error.

The schema of one column of a row or insert schema, as data, [:maybe ...] included; nil for
a column the schema does not have. A name the registry does not hold is an error.
sourceraw docstring

columnsclj

(columns registry name)

The [:map ...] of a row or insert schema, without the table-level constraints: what malli.util's select-keys, optional-keys and the like take (the [:and ...] of a table with constraints is not a map to them).

The [:map ...] of a row or insert schema, without the table-level constraints: what
malli.util's select-keys, optional-keys and the like take (the [:and ...] of a table with
constraints is not a map to them).
sourceraw docstring

generatedclj

(generated schema-name)

The generated file of a schema (from the classpath), as data: {:schema :database-version :registry {name schema} :unrendered [fact ...] :skipped [fact ...] :diagnostics [...]}. :registry is the map of names to schemas a malli registry is made of (registry builds one from it, with malli's own schemas); :unrendered are the facts with no malli rendering; :diagnostics what the database stores but deserves a look (a partitioned table with no partition, a partition its parent's bounds make unreachable, a CHECK (false), CHECKs on a column that contradict each other, a NOT VALID or NOT ENFORCED constraint, a unique index repeating a key, a row-level INSERT trigger), each {:table :kind :confidence :severity :message ...}.

The generated file of a schema (from the classpath), as data: {:schema :database-version
:registry {name schema} :unrendered [fact ...] :skipped [fact ...] :diagnostics [...]}.
:registry is the map of names to schemas a malli registry is made of (registry builds one
from it, with malli's own schemas); :unrendered are the facts with no malli rendering;
:diagnostics what the database stores but
deserves a look (a partitioned table with no partition, a partition its parent's bounds make
unreachable, a CHECK (false), CHECKs on a column that contradict each other, a NOT VALID or
NOT ENFORCED constraint, a unique index repeating a key, a row-level INSERT trigger), each
{:table :kind :confidence :severity :message ...}.
sourceraw docstring

install!clj

(install! & schemas)

Makes the registry of the named schemas malli's default registry (it holds malli's own schemas, malli.util and malli.experimental.time too), so :malli/schema metadata, malli.dev/start! and malli.instrument read :pg.public/users and the other generated names directly. Process-wide, like malli's default registry: for an application with this one registry; one with a registry of its own composes the two (malli.registry/composite-registry) or uses portable, which touches nothing. Returns the schemas the default registry held before, which malli.registry/set-default-registry! puts back.

Makes the registry of the named schemas malli's default registry (it holds malli's own
schemas, malli.util and malli.experimental.time too), so :malli/schema metadata,
malli.dev/start! and malli.instrument read :pg.public/users and the other generated names
directly. Process-wide, like malli's default registry: for an application with this one
registry; one with a registry of its own composes the two (malli.registry/composite-registry)
or uses portable, which touches nothing. Returns the schemas the default registry held
before, which malli.registry/set-default-registry! puts back.
sourceraw docstring

non-nullclj

(non-null schema)

A column schema without its [:maybe ...]: what a value must be when it is not NULL.

A column schema without its [:maybe ...]: what a value must be when it is not NULL.
sourceraw docstring

portableclj

(portable registry name)

The named schema as data malli's default registry reads (plus malli.experimental.time): the schema's own types inlined, pgmalli's types as their malli counterparts, generation hints dropped, the CHECKs only pgmalli evaluates left out. For :malli/schema metadata and other places the registry cannot follow. A name the registry does not hold is an error.

The named schema as data malli's default registry reads (plus malli.experimental.time):
the schema's own types inlined, pgmalli's types as their malli counterparts, generation
hints dropped, the CHECKs only pgmalli evaluates left out. For :malli/schema metadata and
other places the registry cannot follow. A name the registry does not hold is an error.
sourceraw docstring

read-optionsclj

(read-options builder)

The reading options (see as-read) of a next.jdbc result set builder named by its symbol: next.jdbc/as-unqualified-lower-maps, next.jdbc.optional/as-kebab-maps (NULL columns absent) and the like. nil for a builder that builds no map (as-arrays); an error for one pgmalli does not know.

The reading options (see as-read) of a next.jdbc result set builder named by its symbol:
next.jdbc/as-unqualified-lower-maps, next.jdbc.optional/as-kebab-maps (NULL columns absent)
and the like. nil for a builder that builds no map (as-arrays); an error for one pgmalli
does not know.
sourceraw docstring

registryclj

(registry & schemas)

malli registry holding the generated schemas of the named schemas (read from the classpath; generated data maps are accepted too), insert schemas derived from them, plus malli's defaults, malli.util and malli.experimental.time.

malli registry holding the generated schemas of the named schemas (read from the classpath;
generated data maps are accepted too), insert schemas derived from them, plus malli's
defaults, malli.util and malli.experimental.time.
sourceraw docstring

transformerclj

(transformer)
(transformer opts)

malli transformer decoding JDBC and string values into the registry's types. Instants and java.util.Dates that land in date or timestamp (without time zone) columns are read in :zone, default the JVM's; JSON text in json and jsonb columns is parsed.

malli transformer decoding JDBC and string values into the registry's types. Instants and
java.util.Dates that land in date or timestamp (without time zone) columns are read in
:zone, default the JVM's; JSON text in json and jsonb columns is parsed.
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