Liking cljdoc? Tell your friends :D

sqlosure.query-comprehension


!clj

(! 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".
sourceraw docstring

assert-alistclj

(assert-alist caller coll)
source

distinct!clj

source

divideclj

(divide prod1 prod2)
source

embedclj

(embed q)

Embed a RA query into the current query.

Embed a RA query into the current query.
sourceraw docstring

get-queryclj

(get-query prod)
source

groupclj

(group & colrefs)

Group by specified seq of column references [rel name].

Group by specified seq of column references `[rel name]`.
sourceraw docstring

group-refsclj

(group-refs & refs)

Group by specified seq of attribute references (qc/! rel name).

Group by specified seq of attribute references `(qc/! rel name)`.
sourceraw docstring

intersectclj

(intersect prod1 prod2)
source

make-relationclj

(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]]
sourceraw docstring

orderclj

(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".
sourceraw docstring

outerclj

(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.
sourceraw docstring

projectclj

(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".
sourceraw docstring

Relationclj

source

relation-aliasclj

(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]].
sourceraw docstring

relation-schemeclj

(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]].
sourceraw docstring

relation?clj

(relation? thing)

Is object a Relation record? See sqlosure.query-comprehension/make-relation.

Is object a `Relation` record? See [[sqlosure.query-comprehension/make-relation]].
sourceraw docstring

restrictclj

(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.
sourceraw docstring

restrict-outerclj

(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.
sourceraw docstring

restrictedclj

(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).
sourceraw docstring

subtractclj

(subtract prod1 prod2)
source

topclj

(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`.
sourceraw docstring

unionclj

(union p1 & prods)
source

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

× close