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, pgmalli.data; HoneySQL queries checked and typed, pgmalli.honeysql.
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, pgmalli.data; HoneySQL queries checked and typed, pgmalli.honeysql.
(as-read registry name)(as-read registry name opts)The [:map ...] of a table's or view's row as next.jdbc builds it from what PostgreSQL's JDBC driver returns. Validate with {:registry registry}.
(as-read registry :pg.public/users {:qualified? false})
By default, as next.jdbc's default builder (as-maps) builds rows with no extension: keys :table/column, the types docs/reading-rows.md lists. Options: docs/reading-rows.md#options; read-options gives a builder's.
Throws when an option is unknown, or name is no table's or view's row schema.
The [:map ...] of a table's or view's row as next.jdbc builds it from what PostgreSQL's
JDBC driver returns. Validate with {:registry registry}.
(as-read registry :pg.public/users {:qualified? false})
By default, as next.jdbc's default builder (as-maps) builds rows with no extension: keys
:table/column, the types docs/reading-rows.md lists. Options: docs/reading-rows.md#options;
read-options gives a builder's.
Throws when an option is unknown, or name is no table's or view's row schema.(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).
(describe schema)(describe registry schema)A schema as short data for people and tools to read: a column as its PostgreSQL type ("varchar(40)", "timestamptz"), ? when it takes NULL, (optional) when its key may be absent, an enum with its labels ("status: draft | published"); a map as {key description} in column order, a sequence as [description], a function schema as {:args [...] :returns ...}. A name, or a reference inside the schema, is read through the registry.
(describe (h/query-schema registry [:id] q)) (describe registry :pg.public/users)
A schema as short data for people and tools to read: a column as its PostgreSQL type
("varchar(40)", "timestamptz"), ? when it takes NULL, (optional) when its key may be
absent, an enum with its labels ("status: draft | published"); a map as {key description}
in column order, a sequence as [description], a function schema as {:args [...] :returns
...}. A name, or a reference inside the schema, is read through the registry.
(describe (h/query-schema registry [:id] q))
(describe registry :pg.public/users)(generated schema-name)The generated file of a schema, read from the classpath, as data: {:schema :database-version :registry {name schema} :unrendered [entry ...] :skipped [entry ...] :diagnostics [{:table :kind :severity :message ...} ...]}, its entries and diagnostics as docs/types.md#the-generated-file lists them.
:unrendered lists the constraints pgmalli cannot express in malli; :diagnostics what deserves a look in the database (a NOT VALID constraint, an unreachable partition, a row-level INSERT trigger ...).
The generated file of a schema, read from the classpath, as data:
{:schema :database-version :registry {name schema} :unrendered [entry ...]
:skipped [entry ...] :diagnostics [{:table :kind :severity :message ...} ...]},
its entries and diagnostics as docs/types.md#the-generated-file lists them.
:unrendered lists the constraints pgmalli cannot express in malli; :diagnostics what
deserves a look in the database (a NOT VALID constraint, an unreachable partition, a
row-level INSERT trigger ...).(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.
(read-options builder)The reading options (see as-read) of a next.jdbc map builder, named by its symbol or var (#'rs/as-maps): 'next.jdbc.result-set/as-unqualified-kebab-maps, 'next.jdbc.optional/as-maps (NULL columns absent) and the like. An error for another (the modified builders key rows by functions of yours, the array builders build no map).
The reading options (see as-read) of a next.jdbc map builder, named by its symbol or var (#'rs/as-maps): 'next.jdbc.result-set/as-unqualified-kebab-maps, 'next.jdbc.optional/as-maps (NULL columns absent) and the like. An error for another (the modified builders key rows by functions of yours, the array builders build no map).
(registry & schemas)A malli registry of the named schemas' generated files, with the insert and update schemas derived from them, malli's default schemas, malli.util and malli.experimental.time.
(registry "public")
A generated data map (see generated) is taken in place of a name.
A malli registry of the named schemas' generated files, with the insert and update schemas derived from them, malli's default schemas, malli.util and malli.experimental.time. (registry "public") A generated data map (see generated) is taken in place of a name.
(transformer)(transformer opts)malli transformer decoding JDBC and string values into the registry's types. An Instant or java.util.Date in a date or timestamp (without time zone) column is read in :zone, default the JVM's, except a java.sql.Timestamp in a timestamp column (its date and time are kept) and a java.sql.Date in a date column; JSON text in json and jsonb columns is parsed.
malli transformer decoding JDBC and string values into the registry's types. An Instant or java.util.Date in a date or timestamp (without time zone) column is read in :zone, default the JVM's, except a java.sql.Timestamp in a timestamp column (its date and time are kept) and a java.sql.Date in a date column; JSON text in json and jsonb columns is parsed.
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 |