(! rel name)! selects an attribute from a relation.
Example: (! t "id") corresponds to SQL "t.id".
`!` selects an attribute from a relation. Example: (! t "id") corresponds to SQL "t.id".
(->relation alias scheme)Positional factory function for class sqlosure.query_comprehension.relation.
Positional factory function for class sqlosure.query_comprehension.relation.
(embed q)Embed a RA query into the current query.
Embed a RA query into the current query.
(group & colrefs)Group by specified seq of column references [rel name].
Group by specified seq of column references `[rel name]`.
(group-refs & refs)Group by specified seq of attribute references (qc/! rel name).
Group by specified seq of attribute references `(qc/! rel name)`.
(make-relation alias scheme)Construct a relation record.
alias (The current alias.): access via sqlosure.query-comprehension/relation-alias
scheme (The current relation-scheme.): access via sqlosure.query-comprehension/relation-scheme
Construct a `relation` record. `alias` (The current alias.): access via [[sqlosure.query-comprehension/relation-alias]] `scheme` (The current relation-scheme.): access via [[sqlosure.query-comprehension/relation-scheme]]
(map->relation m__7585__auto__)Factory function for class sqlosure.query_comprehension.relation, taking a map of keywords to field values.
Factory function for class sqlosure.query_comprehension.relation, taking a map of keywords to field values.
(order alist)order takes an alist of [[attribute-ref] :descending/:ascending] to order
the result by this attribute.
Example: (monadic [t (embed t-table)] (order {(! t "foo") :ascending}) (project {"foo" (! t "foo")}))
The corresponding SQL statemant would be "SELECT foo FROM t ORDER BY foo ASC".
`order` takes an alist of [[attribute-ref] :descending/:ascending] to order
the result by this attribute.
Example: (monadic [t (embed t-table)]
(order {(! t "foo") :ascending})
(project {"foo" (! t "foo")}))
The corresponding SQL statemant would be "SELECT foo FROM t ORDER BY foo ASC".(outer q)Embed a RA query as an outer query into the current query.
Embed a RA query as an outer query into the current query.
(project alist)Project some columns of the current query. Returns the resulting state.
Example: (monadic [t (<- embed t-table)] (project {"foo" (! t "foo") "bar" (! t "bar"))
The corresponding SQL statemant would be "SELECT foo, bar FROM t".
Project some columns of the current query. Returns the resulting state.
Example: (monadic [t (<- embed t-table)]
(project {"foo" (! t "foo")
"bar" (! t "bar"))
The corresponding SQL statemant would be "SELECT foo, bar FROM t".(project-only alist)Project the some columns of the current query.
Project the some columns of the current query.
(relation-alias relation)Access alias field (The current alias.) from a [[relation]] record. See sqlosure.query-comprehension/make-relation.
Access `alias` field (The current alias.) from a [[relation]] record. See [[sqlosure.query-comprehension/make-relation]].
(relation-scheme relation)Access scheme field (The current relation-scheme.) from a [[relation]] record. See sqlosure.query-comprehension/make-relation.
Access `scheme` field (The current relation-scheme.) from a [[relation]] record. See [[sqlosure.query-comprehension/make-relation]].
(relation? thing)Is object a relation record? See sqlosure.query-comprehension/make-relation.
Is object a `relation` record? See [[sqlosure.query-comprehension/make-relation]].
(restrict expr)Restrict the current query by a condition.
expr -> query(nil)
Note this doesn't return anything.
Restrict the current query by a condition. expr -> query(nil) Note this doesn't return anything.
(restrict-outer expr)Restrict outer part of the current query by a condition.
expr -> query(nil)
Note: this is a monadic action that doesn't return anything.
Restrict outer part of the current query by a condition. expr -> query(nil) Note: this is a monadic action that doesn't return anything.
(restricted rel expr)Restrict the current query by a condition. Returns the resulting state.
Example: (monadic [t (<- embed t-table)] (restricted t ($<= (! t "id") ($integer 1))
The corresponding SQL statement would be "SELECT <all cols of t> FROM t WHERE id <= 1"
relation expr -> query(relation).
Restrict the current query by a condition. Returns the resulting state.
Example: (monadic [t (<- embed t-table)]
(restricted t ($<= (! t "id")
($integer 1))
The corresponding SQL statement would be "SELECT <all cols of t> FROM t WHERE id <= 1"
relation expr -> query(relation).(top n)(top offset n)top is used to define queries that return a cerain number of entries.
When called with one argument n, top constructs a query that only returns
the first n elements.
Whan called with two arguments offset and n, top constructs a query that
returns the first n elements with an offset of offset.
`top` is used to define queries that return a cerain number of entries. When called with one argument `n`, top constructs a query that only returns the first `n` elements. Whan called with two arguments `offset` and `n`, top constructs a query that returns the first `n` elements with an offset of `offset`.
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 |