Query verbs (select/insert/upsert/update/delete) + rpc + aggregations.
Query verbs (select/insert/upsert/update/delete) + rpc + aggregations.
(delete req)(delete req opts)Deletes rows. Filter first or every row in the relation is deleted.
Deletes rows. Filter first or every row in the relation is deleted.
(embed relation cols)(embed relation cols opts)Builds an embedded-resource string for use inside a select vector
(resource embedding / joins across foreign keys).
relation is the related table or FK relationship name. cols is "*"
or a vector of column names (each may itself be an embed string for
nested embeds).
Opts:
:as — alias the embed (alias:relation(...))
:hint — disambiguate the FK relationship for ambiguous embeds
(relation!hint(...))
:inner — boolean; INNER join — drop parent rows with no match
(relation!inner(...))
:left — boolean; explicit LEFT join (relation!left(...))
(embed "messages" [:id :content] {:inner true})
;; => "messages!inner(id,content)"
(embed "users" [:name] {:as "author" :hint "author_id"})
;; => "author:users!author_id(name)"
Builds an embedded-resource string for use inside a `select` vector
(resource embedding / joins across foreign keys).
`relation` is the related table or FK relationship name. `cols` is `"*"`
or a vector of column names (each may itself be an `embed` string for
nested embeds).
Opts:
:as — alias the embed (`alias:relation(...)`)
:hint — disambiguate the FK relationship for ambiguous embeds
(`relation!hint(...)`)
:inner — boolean; INNER join — drop parent rows with no match
(`relation!inner(...)`)
:left — boolean; explicit LEFT join (`relation!left(...)`)
(embed "messages" [:id :content] {:inner true})
;; => "messages!inner(id,content)"
(embed "users" [:name] {:as "author" :hint "author_id"})
;; => "author:users!author_id(name)"(insert req data)(insert req data opts)Inserts data (map or vector of maps).
Inserts `data` (map or vector of maps).
(rpc client fn-name)(rpc client fn-name args)(rpc client fn-name args opts)Calls a database function.
Opts: :head — boolean; when true, send HEAD (no body returned) :get — boolean; when true, send GET (args become query params) :count — :exact | :planned | :estimated
Returns a request builder. Pipe through filters or execute to run.
Calls a database function. Opts: :head — boolean; when true, send HEAD (no body returned) :get — boolean; when true, send GET (args become query params) :count — :exact | :planned | :estimated Returns a request builder. Pipe through filters or `execute` to run.
(select req columns)(select req columns opts)Builds a SELECT.
columns is "*", a string, or a vector of strings/keywords.
Opts:
:count — :exact | :planned | :estimated (default :exact)
:returning — boolean; when true, performs GET; when false, HEAD
(default false — only headers + count are returned)
Builds a SELECT.
`columns` is `"*"`, a string, or a vector of strings/keywords.
Opts:
:count — :exact | :planned | :estimated (default :exact)
:returning — boolean; when true, performs GET; when false, HEAD
(default false — only headers + count are returned)(update req data)(update req data opts)Updates rows with data. Filter the rows with eq/gt/... before
calling, or every row matching the relation will be updated.
Updates rows with `data`. Filter the rows with `eq`/`gt`/... before calling, or every row matching the relation will be updated.
(upsert req data)(upsert req data opts)Upserts data. Defaults to resolution=merge-duplicates.
Upserts `data`. Defaults to `resolution=merge-duplicates`.
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 |