Liking cljdoc? Tell your friends :D

sqlosure.core


!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

$<clj

source

$<=clj

source

$=clj

source

$>clj

source

$>=clj

source

$andclj

source

$anyclj

($any val)
source

$avgclj

($avg aref)

Aggregation. Calculates average of column aref.

Aggregation. Calculates average of column `aref`.
sourceraw docstring

$avg*clj

Aggregation. Calculate average of whole relation (AVG(*)).

Aggregation. Calculate average of whole relation (`AVG(*)`).
sourceraw docstring

$betweenclj

source

$blobclj

($blob val)
source

$blob-nullclj

($blob-null val)
source

$blob-null-tclj

source

$blob-tclj

source

$booleanclj

($boolean val)
source

$boolean-tclj

source

$byteaclj

($bytea val)
source

$bytea-nullclj

($bytea-null val)
source

$bytea-null-tclj

source

$bytea-tclj

source

$concatclj

source

$countclj

($count aref)

Aggregation. Count column aref.

Aggregation. Count column `aref`.
sourceraw docstring

$count*clj

Aggregation. Count whole relation (COUNT(*)).

Aggregation. Count whole relation (`COUNT(*)`).
sourceraw docstring

$dateclj

($date val)
source

$date-null-tclj

source

$date-tclj

source

$doubleclj

($double val)
source

$double-nullclj

($double-null val)
source

$double-null-tclj

source

$double-tclj

source

$inclj

source

$integerclj

($integer val)
source

$integer-nullclj

($integer-null val)
source

$integer-null-tclj

source

$integer-tclj

source

$is-not-null?clj

source

$is-null?clj

source

$likeclj

source

$lowerclj

source

$maxclj

($max aref)

Aggretation. Calculates maximum of column aref.

Aggretation. Calculates maximum of column `aref`.
sourceraw docstring

$max*clj

Aggregation. Calculate maximum of whole relation (MAX(*)).

Aggregation. Calculate maximum of whole relation (`MAX(*)`).
sourceraw docstring

$minclj

($min aref)

Aggregation. Calculates minimum of column aref.

Aggregation. Calculates minimum of column `aref`.
sourceraw docstring

$min*clj

Aggregation. Calculate minimum of whole relation (MIN(*)).

Aggregation. Calculate minimum of whole relation (`MIN(*)`).
sourceraw docstring

$minusclj

source

$notclj

source

$nullclj

($null val)
source

$orclj

source

$plusclj

source

$std-devclj

Aggregation. Calculate standart deviation of whole relation (STDEV(*)).

Aggregation. Calculate standart deviation of whole relation (`STDEV(*)`).
sourceraw docstring

$std-dev-pclj

source

$stringclj

($string val)
source

$string-nullclj

($string-null val)
source

$string-null-tclj

source

$string-tclj

source

$sumclj

($sum aref)

Aggregation. Sum column aref.

Aggregation. Sum column `aref`.
sourceraw docstring

$sum*clj

Aggregation. Sum up whole relation (SUM(*)).

Aggregation. Sum up whole relation (`SUM(*)`).
sourceraw docstring

$timestampclj

($timestamp val)
source

$timestamp-tclj

source

$upperclj

source

$varclj

Aggregation. Calculate variance of whole relation (VAR(*)).

Aggregation. Calculate variance of whole relation (`VAR(*)`).
sourceraw docstring

$var-pclj

source

<-clj

(<- q)

Embed a RA query into the current query.

Embed a RA query into the current query.
sourceraw docstring

aggregateclj

(aggregate aggregation-op & attribute)

aggregate takes an aggregation-operator (:count, :avg, etc.) an optionally an sqlosure.relational-algebra/attribute-ref and returns an aggregation. If no attribute is provided, returns an aggregation on the whole relation, otherwise on the specified attribute.

`aggregate` takes an aggregation-operator (:count, :avg, etc.) an optionally
an `sqlosure.relational-algebra/attribute-ref` and returns an aggregation.
If no `attribute` is provided, returns an aggregation on the whole relation,
otherwise on the specified attribute.
sourceraw docstring

db-connectclj

(db-connect db-spec backend)

db-connect takes a connection map and returns a db-connection-record for that backend. Dispatches on the :classname key in db-spec.

`db-connect` takes a connection map and returns a `db-connection`-record for
that backend. Dispatches on the `:classname` key in `db-spec`.
sourceraw docstring

distinct!clj

distinct! is used to define queries that only return distinct rows. Will result in a DISTINCT clause in the resulting SQL.

`distinct!` is used to define queries that only return distinct rows.
Will result in a `DISTINCT` clause in the resulting SQL.
sourceraw docstring

groupclj

(group alist)
source

group!clj

(group! alist)

Group by specified seq of column references [rel name]. Example (query [t (<- embed t-table)] (group [t "some_field"])

Group by specified seq of column references `[rel name]`.
Example
    (query [t (<- embed t-table)]
           (group [t "some_field"])
sourceraw docstring

orderclj

(order alist)
source

order!clj

(order! alist)
(order! attr direction & more-orders)

Takes an alist of [[attribute-ref] :descending/:ascending] to order the result by this attribute.

Example: (query [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".

Takes an alist of [[attribute-ref] :descending/:ascending] to order
the result by this attribute.

Example:
    (query [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

projectclj

(project alist-or-relation)
(project project-name project-field & more-projections)

Project some columns of the current query. Returns the resulting state.

Example: (query [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:
    (query [t (<- embed t-table)]
              (project {"foo" (! t "foo")
                        "bar" (! t "bar"))

The corresponding SQL statemant would be "SELECT foo, bar FROM t".
sourceraw docstring

put-queryclj

(put-query q & {:keys [optimize?]})

put-query takes a (relational algebra) query and returns it's (SQL-) string representation. Uses the default printer from sqlosure.sql-put.

`put-query` takes a (relational algebra) query and returns it's (SQL-) string
representation. Uses the default printer from `sqlosure.sql-put`.
sourceraw docstring

querycljmacro

(query & ?forms)

query takes a series of relational algebra statements (projection, selection, grouping, etc.) and returns an executable relational algebra query. The last statement must be a monadic return (either return or projection).

`query` takes a series of relational algebra statements (projection,
selection, grouping, etc.) and returns an executable relational algebra query.
The last statement must be a monadic return (either return or projection).
sourceraw docstring

restrictclj

(restrict expr)
source

restrict!clj

(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)
source

restrict-outer!clj

(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 expr)
source

restricted!clj

(restricted! expr)

Restrict the current query by a condition. Returns the resulting state.

Example: (query [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:
    (query [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

tableclj

(table sql-name map & opts)

Returns a sqlosure.relational-algebra/base-relation. sql-name ist the name of the table in the DBMS, map is a map of column-name -> sqlosure.type-type. opts may contain a :universe key and a universe (defaults to nil).

Returns a `sqlosure.relational-algebra/base-relation`.
`sql-name` ist the name of the table in the DBMS, `map` is a map of column-name
-> sqlosure.type-type. `opts` may contain a :universe key and a universe
(defaults to `nil`).
sourceraw docstring

topclj

source

top!clj

(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

variadic->alistclj

(variadic->alist arg1 arg2 args)
source

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

× close