Liking cljdoc? Tell your friends :D

Changelog

All notable changes to this project are documented here. The format follows Keep a Changelog.

[0.2.40] - 2026-09-03

Added

  • Views and materialized views as :pg.<schema>/<view> row schemas: columns and types, every column nullable, :pg/view on the map. They get no insert schema and are not part of datasets.

[0.2.38] - 2026-09-03

Changed

  • smallint and integer columns are :pg/smallint and :pg/integer, schema types pgmalli registers with the PostgreSQL range inside, narrowed by the :min and :max a CHECK adds; the generated files no longer spell the range out.
  • :database-version is the server version alone ("PostgreSQL 17.6"), the same on every machine that generates.

[0.2.35] - 2026-09-03

Added

  • :pg/check and :pg/check-value: every CHECK that no column pattern covers is kept as expression data and evaluated with PostgreSQL's semantics (NULL passes, AND, OR and COALESCE stop at the first decisive operand, casts convert, the schema's own enum and domain literals are values, now() is the validation time). The vocabulary covers comparison, logic, arithmetic, the common string, numeric, array and jsonb functions and operators, LIKE, regexes and CASE; a CHECK outside it is listed in :unrendered. jsonb values with string or keyword keys are read alike.
  • CHECKs that branch on one column's value become [:multi ...]; ORs of column patterns [:or ...]; neither is ever enforced in part.
  • :pg.<schema>.<table>/insert schemas, derived when a registry is loaded: identity ALWAYS and generated columns removed, identity BY DEFAULT, defaulted and nullable columns optional, closed maps; the table's constraints see omitted columns as their literal defaults, else NULL.
  • Row schemas carry :pg/table ("schema.table"), :pg/primary-key, :pg/unique ({:columns} maps, :nulls-distinct false for NULLS NOT DISTINCT) and :pg/foreign-keys ({:columns :table :to} maps, :match :full for MATCH FULL) on the map; columns carry :pg/identity (:always, :default, :serial) and :pg/generated.
  • Domain types as registry entries: base type, column patterns, else [:pg/check-value expr]; a domain's NOT NULL and DEFAULT reach its columns; :overrides apply to domain CHECKs.
  • Column patterns for LIKE, NOT IN, cardinality, array_length, boolean and uuid value sets; bounds and value sets from several constraints tighten and intersect.
  • smallint and integer carry their range; numeric(p, s) its magnitude bound; bytea with a length CHECK is [:pg/bytes {:min :max}], a type that generates byte arrays.
  • date, time, timetz, timestamp, timestamptz and interval map to malli.experimental.time schemas.
  • pgmalli/columns, pgmalli/transformer (with a :zone option; JSON text in json and jsonb columns is parsed), pgmalli/dataset-schema (every key set and reference a named check; NULLS NOT DISTINCT and MATCH FULL respected) and pgmalli/dataset-generator (:rows, :except; references sharing columns solved together, self-references included; a reference that finds no fitting row grows its target table; tables that come out short are listed in the dataset's metadata with the reasons). Registries add generation hints when loaded, so key columns are small positive integers, strings short and times recent.
  • POSIX character classes in regexes are translated to their Java form; patterns using PostgreSQL-only escapes stay unrendered.
  • Types outside the mapping table are reported as :unknown-type.

Changed

  • Files generated by 0.1 are refused when loaded; regenerate them.
  • Registries load from the classpath by schema name: (pgmalli/registry "public"). malli is a dependency of the library.
  • Trimmed non-blank strings are [:and [:string {:min 1}] [:re "\S"]].
  • Schema names that are not plain identifiers make string registry keys.
  • Generating needs PostgreSQL 16 or later.

Removed

  • pgmalli/path and the by-path forms of registry and unrendered.

[0.1.9] - 2026-09-02

Added

  • Generate malli registries from an applied PostgreSQL schema through psql.
  • Public API pgmalli.core (generate!, path, registry, stale, unrendered) and the pgmalli.main command line.
  • Fixed renderings for enum types, value sets, ranges, non-blank strings, lengths, jsonb types, regexes and conditional nullability; everything else is reported as unrendered.

Can you improve this documentation?Edit on GitHub

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