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

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

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

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

registryclj

(registry & schemas)

The registry pgmalli.core/registry documents.

The registry pgmalli.core/registry documents.
sourceraw docstring

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