Liking cljdoc? Tell your friends :D

pgmalli.impl.expr

Turns expressions as printed by PostgreSQL's deparser (pg_get_constraintdef, pg_get_expr) into HoneySQL-style data. Only that output format is supported, not arbitrary SQL.

Covered: comparison, logical, arithmetic, string, array, jsonb and regex operators (see edn-safe-ops); IS [NOT] NULL/TRUE/FALSE; IS [NOT] DISTINCT FROM; [NOT] IN; ANY/ALL (ARRAY[...]); [NOT] BETWEEN [SYMMETRIC]; [NOT] LIKE/ILIKE; ::casts; function calls; TRIM(BOTH FROM x); CASE; CURRENT_TIMESTAMP and friends; AT TIME ZONE; (x).field; x[i]; quoted identifiers; string, number, boolean and NULL literals.

Operators whose symbol is not a readable EDN keyword (~, @>, ...) get a named keyword (see edn-safe-ops); ->honeysql maps them back when SQL has to be generated.

Turns expressions as printed by PostgreSQL's deparser (pg_get_constraintdef, pg_get_expr)
into HoneySQL-style data. Only that output format is supported, not arbitrary SQL.

Covered: comparison, logical, arithmetic, string, array, jsonb and regex operators (see
edn-safe-ops); IS [NOT] NULL/TRUE/FALSE; IS [NOT] DISTINCT FROM; [NOT] IN; ANY/ALL (ARRAY[...]);
[NOT] BETWEEN [SYMMETRIC]; [NOT] LIKE/ILIKE; ::casts; function calls; TRIM(BOTH FROM x);
CASE; CURRENT_TIMESTAMP and friends; AT TIME ZONE; (x).field; x[i]; quoted identifiers;
string, number, boolean and NULL literals.

Operators whose symbol is not a readable EDN keyword (~, @>, ...) get a named keyword
(see edn-safe-ops); ->honeysql maps them back when SQL has to be generated.
raw docstring

->honeysqlclj

(->honeysql e)

Replaces the EDN-safe operator names with the symbols HoneySQL formats.

Replaces the EDN-safe operator names with the symbols HoneySQL formats.
sourceraw docstring

canonicalclj

(canonical e)

Undoes rewrites PostgreSQL applies when deparsing, without changing meaning: numeric literals printed as casts ('-1'::integer -> -1), array casts, col = ANY (ARRAY[...]) -> [:in col [...]], col <> ALL (ARRAY[...]) -> [:not-in col [...]], and a one-element IN -> = (NOT IN -> <>).

Undoes rewrites PostgreSQL applies when deparsing, without changing meaning:
numeric literals printed as casts ('-1'::integer -> -1), array casts,
col = ANY (ARRAY[...]) -> [:in col [...]], col <> ALL (ARRAY[...]) -> [:not-in col [...]],
and a one-element IN -> = (NOT IN -> <>).
sourceraw docstring

check-clauseclj

(check-clause s)

The expression inside "CHECK (...)" as data. Trailing NOT VALID / NO INHERIT are ignored.

The expression inside "CHECK (...)" as data. Trailing NOT VALID / NO INHERIT are ignored.
sourceraw docstring

edn-safe-opsclj

PostgreSQL operators whose keyword form is not readable EDN, and the names used instead.

PostgreSQL operators whose keyword form is not readable EDN, and the names used instead.
sourceraw docstring

parseclj

(parse s)

Expression string -> data. Throws ex-info with :input (and :pos or :got) when it cannot be read.

Expression string -> data. Throws ex-info with :input (and :pos or :got) when it cannot be read.
sourceraw docstring

try-parseclj

(try-parse s)

Like parse, but returns {:expr e} or {:error message :input s}.

Like parse, but returns {:expr e} or {:error message :input s}.
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