(! 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".
(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]]
(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".
(relation-alias rec__2313__auto__)
(relation-alias data__2314__auto__ v__2315__auto__)
Lens for the alias
field (The current alias.) from a Relation
record. See sqlosure.query-comprehension/make-relation
.
Lens for the `alias` field (The current alias.) from a [[Relation]] record. See [[sqlosure.query-comprehension/make-relation]].
(relation-scheme rec__2313__auto__)
(relation-scheme data__2314__auto__ v__2315__auto__)
Lens for the scheme
field (The current relation-scheme.) from a Relation
record. See sqlosure.query-comprehension/make-relation
.
Lens for the `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 is a website building & hosting documentation for Clojure/Script libraries
× close