Liking cljdoc? Tell your friends :D

pgmalli.impl.runtime

The application side: generated files as malli registries, plus helpers that need malli. Generated files are read from the classpath as pgmalli/<schema>.edn.

The application side: generated files as malli registries, plus helpers that need malli.
Generated files are read from the classpath as pgmalli/<schema>.edn.
raw docstring

as-readclj

(as-read registry name {:keys [qualified? kebab? nil-columns time]})

The [:map ...] of a row as a JDBC result builder returns it; the options are documented on pgmalli.core/as-read.

The [:map ...] of a row as a JDBC result builder returns it; the options are documented on
pgmalli.core/as-read.
sourceraw docstring

bytes-schemaclj

[:pg/bytes {:min n :max n}]: a byte array of bounded length, generated as such (malli's bytes? has no length).

[:pg/bytes {:min n :max n}]: a byte array of bounded length, generated as such (malli's bytes?
has no length).
sourceraw docstring

check-schemaclj

[:pg/check expr]: a row passes when the CHECK expression data does (pgmalli.impl.eval). A column missing from the row is NULL, or its value in the :pg/defaults property.

[:pg/check expr]: a row passes when the CHECK expression data does (pgmalli.impl.eval).
A column missing from the row is NULL, or its value in the :pg/defaults property.
sourceraw docstring

check-value-schemaclj

[:pg/check-value expr]: a domain CHECK, the value standing for VALUE.

[:pg/check-value expr]: a domain CHECK, the value standing for VALUE.
sourceraw docstring

columnclj

(column registry name col)

The schema of one column of a row or insert schema, as data (with its [:maybe ...]).

The schema of one column of a row or insert schema, as data (with its [:maybe ...]).
sourceraw docstring

column-entriesclj

(column-entries schema)

[[column props schema] ...] of a row or insert schema as data.

[[column props schema] ...] of a row or insert schema as data.
sourceraw docstring

columnsclj

(columns registry name)

The [:map ...] of a row or insert schema, without the table-level constraints.

The [:map ...] of a row or insert schema, without the table-level constraints.
sourceraw docstring

dataset-generatorclj

(dataset-generator registry)
(dataset-generator registry {:keys [rows except] :or {rows 5}})

test.check generator of datasets that satisfy dataset-schema: tables are generated in foreign-key order and referencing columns are pointed at rows generated before them (a self-reference at the same table); a reference that finds no fitting row grows its target table by one row that fits, whose own references may grow their targets in turn. :rows is the number of rows wanted per table, out of many more candidates; a table that comes out short (a CHECK random rows cannot satisfy, a parent that came out empty) is recorded in the dataset's metadata under :pgmalli/short with the reasons, and its children come out short too. :except names tables ("schema.table") to leave out; a kept table may not reference one of them.

test.check generator of datasets that satisfy dataset-schema: tables are generated in
foreign-key order and referencing columns are pointed at rows generated before them (a
self-reference at the same table); a reference that finds no fitting row grows its target
table by one row that fits, whose own references may grow their targets in turn. :rows is
the number of rows wanted per table, out of many more candidates; a table that comes out
short (a CHECK random rows cannot satisfy, a parent that came out empty) is recorded in
the dataset's metadata under :pgmalli/short with the reasons, and its children come out
short too. :except names tables ("schema.table") to leave out; a kept table may not
reference one of them.
sourceraw docstring

dataset-schemaclj

(dataset-schema registry)

Schema for {"schema.table" [row ...] ...} covering every table of the registry: rows validate against their row schemas, and every primary key, unique constraint and foreign key is a check of its own, named in its error. The result contains functions, so it is built at runtime.

Schema for {"schema.table" [row ...] ...} covering every table of the registry: rows validate
against their row schemas, and every primary key, unique constraint and foreign key is a
check of its own, named in its error. The result contains functions, so it is built at runtime.
sourceraw docstring

insert-nameclj

(insert-name row-name)

:pg.<schema>/<table> -> :pg.<schema>.<table>/insert, string keys alike.

:pg.<schema>/<table> -> :pg.<schema>.<table>/insert, string keys alike.
sourceraw docstring

integer-schemaclj

source

non-nullclj

(non-null schema)

A column schema without its [:maybe ...]: the type a value must have when it is not NULL.

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

portableclj

(portable registry name)

The schema named in the registry as data malli's default registry reads (with malli.experimental.time for the time types): references to the schema's own types inlined, :pg/smallint and :pg/integer as bounded :int, :pg/bytes as bytes?, generation hints dropped. The CHECKs only pgmalli evaluates (:pg/check, :pg/check-value) are left out, so this is weaker than the registry's schema; use it where the registry cannot follow.

The schema named in the registry as data malli's default registry reads (with
malli.experimental.time for the time types): references to the schema's own types inlined,
:pg/smallint and :pg/integer as bounded :int, :pg/bytes as bytes?, generation hints dropped.
The CHECKs only pgmalli evaluates (:pg/check, :pg/check-value) are left out, so this is
weaker than the registry's schema; use it where the registry cannot follow.
sourceraw docstring

portable-dataclj

(portable-data registry schema)

Schema data from the registry as data malli's default registry reads; see portable.

Schema data from the registry as data malli's default registry reads; see portable.
sourceraw docstring

read-generatedclj

(read-generated schema)

The generated data for a schema name, from the classpath (pgmalli/<schema>.edn).

The generated data for a schema name, from the classpath (pgmalli/<schema>.edn).
sourceraw docstring

read-timeclj

(read-time time schema)

Schema data with the time types a driver returns under :time: :instant when timestamps arrive as Instants (dates stay java.sql.Date, hence inst?), :local when timestamptz arrives as LocalDateTime, :inst when the schema is read without malli.experimental.time.

Schema data with the time types a driver returns under :time: :instant when timestamps
arrive as Instants (dates stay java.sql.Date, hence inst?), :local when timestamptz arrives
as LocalDateTime, :inst when the schema is read without malli.experimental.time.
sourceraw docstring

registryclj

(registry & schemas)

The registry pgmalli.core/registry documents.

The registry pgmalli.core/registry documents.
sourceraw docstring

smallint-schemaclj

source

transformerclj

(transformer)
(transformer {:keys [zone] :or {zone (java.time.ZoneId/systemDefault)}})

Decodes JDBC and string values into the registry's types: java.sql.Timestamp and java.util.Date -> Instant, java.sql.Date -> LocalDate, an Instant or java.util.Date landing in a date or timestamp (without time zone) column is read in :zone, default the JVM's; JSON text in a json or jsonb column is parsed.

Decodes JDBC and string values into the registry's types: java.sql.Timestamp and
java.util.Date -> Instant, java.sql.Date -> LocalDate, an Instant or java.util.Date landing
in a date or timestamp (without time zone) column is read in :zone, default the JVM's;
JSON text in a json or jsonb column 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