The schema types pgmalli registers for PostgreSQL's own: the CHECK types, a bytea of bounded length, the bounded numbers (with the ranges the integer types hold) and the arrays the JDBC driver takes.
The schema types pgmalli registers for PostgreSQL's own: the CHECK types, a bytea of bounded length, the bounded numbers (with the ranges the integer types hold) and the arrays the JDBC driver takes.
[: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; the :pg/types property holds the column types the evaluator reads (pgmalli.impl.eval/column-type).
[: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; the :pg/types property holds the column types the evaluator reads (pgmalli.impl.eval/column-type).
[:pg/check-value expr]: a domain CHECK, the value standing for VALUE, whose type the :pg/types property holds as :pg/check's does ({:VALUE :integer}).
[:pg/check-value expr]: a domain CHECK, the value standing for VALUE, whose type the
:pg/types property holds as :pg/check's does ({:VALUE :integer}).:double, a real (:pg/type) within single precision's range: PostgreSQL rejects a value that overflows it or underflows to zero.
:double, a real (:pg/type) within single precision's range: PostgreSQL rejects a value that overflows it or underflows to zero.
The range each integer type pgmalli registers holds (a bigint is exactly a long, so it is :int).
The range each integer type pgmalli registers holds (a bigint is exactly a long, so it is :int).
[:pg/numeric {:precision p :scale s}]: a BigDecimal a numeric(p, s) column stores: rounded to s places (half up, as PostgreSQL rounds on the way in), fewer than p - s digits before the point. s may exceed p, or be negative, as PostgreSQL allows.
[:pg/numeric {:precision p :scale s}]: a BigDecimal a numeric(p, s) column stores: rounded to
s places (half up, as PostgreSQL rounds on the way in), fewer than p - s digits before the
point. s may exceed p, or be negative, as PostgreSQL allows.[:re re] as malli's, except a value java.util.regex runs out of stack on fails instead of throwing StackOverflowError (a regex such as ^([a-z0-9]|-)+$ recurses once per character, and malli catches Exception alone). It fails rather than passes since the registry holds the application's own :re schemas too, which no database CHECK may stand behind.
[:re re] as malli's, except a value java.util.regex runs out of stack on fails instead of throwing StackOverflowError (a regex such as ^([a-z0-9]|-)+$ recurses once per character, and malli catches Exception alone). It fails rather than passes since the registry holds the application's own :re schemas too, which no database CHECK may stand behind.
The schema types pgmalli registers, by name.
The schema types pgmalli registers, by name.
:string with :min and :max counting characters (code points), as PostgreSQL's length and varchar(n) do, where malli's counts UTF-16 units. :pg/max-length n is a varchar(n) or char(n): it cuts spaces past n off, then :min and :max count what it keeps. A bit string (:pg/type bit or bit varying) holds 0s and 1s alone.
:string with :min and :max counting characters (code points), as PostgreSQL's length and varchar(n) do, where malli's counts UTF-16 units. :pg/max-length n is a varchar(n) or char(n): it cuts spaces past n off, then :min and :max count what it keeps. A bit string (:pg/type bit or bit varying) holds 0s and 1s alone.
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 |