Liking cljdoc? Tell your friends :D
Clojure only.

pgmalli.impl.pattern

Facts about a schema, derived from the structure read by pgmalli.impl.ir.

A fact is a map with :fact (the kind), :schema, and :table / :column / :constraint where they apply. Column-local CHECK constraints are matched against a fixed set of patterns; anything else is kept as :table-check with the expression data, never dropped.

Kinds: :enum-type an enum type of the schema {:type-name :values} :column a column {:type :position :nullable? :default :identity? :generated} :enum column of an enum type {:type-name :values} :unknown-type type outside the mapping table {:type} :max-length varchar(n) {:max} :numeric numeric(p,s) {:precision :scale} :in-set col IN (...) / col = v {:values} :range col >= a AND col <= b, BETWEEN, ... {:min :max :min-exclusive? :max-exclusive?} :non-blank length(trim(col)) > 0 / col <> '' {:trim?} :length length(col) <= n / octet_length = n {:fn :min :max :exact} :json-type jsonb_typeof(col) = 'object' {:json-type} :regex col ~ 're' {:re :case-insensitive?} :not-null col IS NOT NULL :when-present col IS NULL OR <column pattern> {:fact-when-present} :table-check CHECK that matched no pattern {:expr :columns :valid?} :unparsed expression that could not be read {:input :error}

One CHECK can yield several facts (column patterns joined by AND). NOT VALID constraints are never matched, since existing rows may violate them.

Facts about a schema, derived from the structure read by pgmalli.impl.ir.

A fact is a map with :fact (the kind), :schema, and :table / :column / :constraint where they
apply. Column-local CHECK constraints are matched against a fixed set of patterns; anything
else is kept as :table-check with the expression data, never dropped.

Kinds:
  :enum-type    an enum type of the schema           {:type-name :values}
  :column       a column                              {:type :position :nullable? :default :identity? :generated}
  :enum         column of an enum type                {:type-name :values}
  :unknown-type type outside the mapping table       {:type}
  :max-length   varchar(n)                            {:max}
  :numeric      numeric(p,s)                          {:precision :scale}
  :in-set       col IN (...) / col = v                {:values}
  :range        col >= a AND col <= b, BETWEEN, ...   {:min :max :min-exclusive? :max-exclusive?}
  :non-blank    length(trim(col)) > 0 / col <> ''     {:trim?}
  :length       length(col) <= n / octet_length = n   {:fn :min :max :exact}
  :json-type    jsonb_typeof(col) = 'object'          {:json-type}
  :regex        col ~ 're'                            {:re :case-insensitive?}
  :not-null     col IS NOT NULL
  :when-present col IS NULL OR <column pattern>       {:fact-when-present}
  :table-check  CHECK that matched no pattern         {:expr :columns :valid?}
  :unparsed     expression that could not be read     {:input :error}

One CHECK can yield several facts (column patterns joined by AND). NOT VALID constraints
are never matched, since existing rows may violate them.
raw docstring

coverageclj

(coverage facts)

Counts per fact kind; :checks restricts to facts that came from CHECK constraints.

Counts per fact kind; :checks restricts to facts that came from CHECK constraints.
sourceraw docstring

factsclj

(facts schema)

Facts of one schema, ordered by type name, table name, column name and constraint name. Column positions are not used for ordering because they depend on migration order.

Facts of one schema, ordered by type name, table name, column name and constraint name.
Column positions are not used for ordering because they depend on migration order.
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