Liking cljdoc? Tell your friends :D

honey.sql.pg-ops

Register all the PostgreSQL JSON/JSONB operators and provide convenient Clojure names for those ops. In addition, provide names for the PostgreSQL regex operators as well.

For the eleven that cannot be written directly as symbols, use mnemonic names: hash for #, at for @, and tilde for ~.

For the six of those that cannot be written as keywords, invoke the keyword function instead.

Those latter eight (at>, <at, at?, atat, tilde, tilde*, !tilde, and !tilde*) are the only ones that should really be needed in the DSL. The other names are provided for completeness.

regex and iregex are provided as aliases for the regex operators tilde and tilde* respectively. !regex and !iregex are provided as aliases for the regex operators !tilde and !tilde* respectively.

Register all the PostgreSQL JSON/JSONB operators
and provide convenient Clojure names for those ops.
In addition, provide names for the PostgreSQL
regex operators as well.

For the eleven that cannot be written directly as
symbols, use mnemonic names: hash for #, at for @,
and tilde for ~.

For the six of those that cannot be written as
keywords, invoke the `keyword` function instead.

Those latter eight (`at>`, `<at`, `at?`, `atat`,
`tilde`, `tilde*`, `!tilde`, and `!tilde*`) are
the only ones that should really be needed in the
DSL. The other names are provided for completeness.

`regex` and `iregex` are provided as aliases for the
regex operators `tilde` and `tilde*` respectively.
`!regex` and `!iregex` are provided as aliases for the
regex operators `!tilde` and `!tilde*` respectively.
raw docstring

!iregexclj/s

source

!regexclj/s

source

!tildeclj/s

The case-sensitive regex unmatch operator.

The case-sensitive regex unmatch operator.
sourceraw docstring

!tilde*clj/s

The case-insensitive regex unmatch operator.

The case-insensitive regex unmatch operator.
sourceraw docstring

-clj/s

The - operator:

  • text value: deletes a key (and its value) from a JSON object, or matching string value(s) from a JSON array
  • text[] array value: as above, but for all the provided keys
  • int value: deletes the array element with specified index (negative integers count from the end)
The - operator: 
- text value: deletes a key (and its value) from a JSON object, or matching string value(s) from a JSON array
- text[] array value: as above, but for all the provided keys
- int value: deletes the array element with specified index (negative integers count from the end)
sourceraw docstring

->clj/s

The -> operator for accessing nested JSON(B) values as JSON(B). Ex.:

(sql/format {:select [[[:->> [:-> :my_column "kids" [:inline 0]] "name"]]]})
; => ["SELECT (my_column -> ? -> 0) ->> ?" "kids" "name"]

Notice we need to wrap the keys/indices with :inline if we don't want them to become parameters.

The -> operator for accessing nested JSON(B) values as JSON(B).
Ex.: 
```clojure
(sql/format {:select [[[:->> [:-> :my_column "kids" [:inline 0]] "name"]]]})
; => ["SELECT (my_column -> ? -> 0) ->> ?" "kids" "name"]
```

Notice we need to wrap the keys/indices with :inline if we don't want them to become parameters.
sourceraw docstring

->>clj/s

The ->> operator - like -> but returns the value as text instead of a JSON object.

The ->> operator - like -> but returns the value as text instead of a JSON object.
sourceraw docstring

<atclj/s

The <@ operator - is the first JSON value contained in the second?

The <@ operator - is the first JSON value contained in the second?
sourceraw docstring

?clj/s

The ? operator - does the text string exist as a top-level key or array element within the JSON value?

The ? operator - does the text string exist as a top-level key or array element within the JSON value?
sourceraw docstring

?&clj/s

The ?& operator - do all of the strings in the text array exist as top-level keys or array elements?

The ?& operator - do all of the strings in the text array exist as top-level keys or array elements?
sourceraw docstring

?|clj/s

The ?| operator - do any of the strings in the text array exist as top-level keys or array elements?

The ?| operator - do any of the strings in the text array exist as top-level keys or array elements?
sourceraw docstring

at>clj/s

The @> operator - does the first JSON value contain the second?

The @> operator - does the first JSON value contain the second?
sourceraw docstring

at?clj/s

The @? operator - does JSON path return any item for the specified JSON value?

The @? operator - does JSON path return any item for the specified JSON value?
sourceraw docstring

atatclj/s

The @@ operator:

  • returns the result of a JSON path predicate check for the specified JSON value. Only the first item of the result is taken into account. If the result is not Boolean, then NULL is returned.
  • checks if a text search vector (or a text value implicitly converted to a text search vector) matches a text search query. Returns a Boolean.
The @@ operator:
- returns the result of a JSON path predicate check for the specified JSON value. Only the first item of the result is taken into account. 
  If the result is not Boolean, then NULL is returned.
- checks if a text search vector (or a text value implicitly converted to a text search vector) matches a text search query. Returns a Boolean.
sourceraw docstring

hash-clj/s

The #- operator - deletes the field or array element at the specified path, where path elements can be either field keys or array indexes.

The #- operator - deletes the field or array element at the specified path, where path elements can be either field keys or array indexes.
sourceraw docstring

hash>clj/s

The #> operator extracts JSON sub-object at the specified path.

The #> operator extracts JSON sub-object at the specified path.
sourceraw docstring

hash>>clj/s

The #>> operator - like hash> but returns the value as text instead of JSON object.

The #>> operator - like hash> but returns the value as text instead of JSON object.
sourceraw docstring

iregexclj/s

source

regexclj/s

source

tildeclj/s

The case-sensitive regex match operator.

The case-sensitive regex match operator.
sourceraw docstring

tilde*clj/s

The case-insensitive regex match operator.

The case-insensitive regex match operator.
sourceraw docstring

||clj/s

The || operator - concatenates two jsonb values (arrays or objects; anything else treated as 1-element array).

The || operator - concatenates two jsonb values (arrays or objects; anything else treated as 1-element array).
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close