Liking cljdoc? Tell your friends :D

com.verybigthings.penkala.relation


->deletableclj

(->deletable rel)

Converts a relation into an "deletable" record which can be used to compose a delete query

Converts a relation into an "deletable" record which can be used to compose a delete query
sourceraw docstring

->insertableclj

(->insertable rel)

Converts a relation into an "insertable" record which can be used to compose an insert query

Converts a relation into an "insertable" record which can be used to compose an insert query
sourceraw docstring

->on-conflict-updatesclj

(->on-conflict-updates updates)
source

->updatableclj

(->updatable rel)

Converts a relation into an "updatable" record which can be used to compose an update query

Converts a relation into an "updatable" record which can be used to compose an update query
sourceraw docstring

->writeableclj

(->writeable constructor rel)
source

-writeable-returningclj

(-writeable-returning rel projection)
source

all-operationsclj

source

and-predicateclj

(and-predicate rel predicate-type predicate-expression)
source

as-ctecljmacro

(as-cte & args)
source

cross-joinclj

(cross-join rel join-rel join-alias)
(cross-join rel join-rel join-alias join-projection)
source

cte->base-cteclj

(cte->base-cte cte)
source

cte->recursive-cteclj

(cte->recursive-cte cte-name recursive-type cte-rel recursive-rel)
source

cte-cycleclj

(cte-cycle rel col-name virtual-col-name using-virtual-col-name)
source

cte-extend-virtualclj

(cte-extend-virtual rel virtual-col-name)
source

cte-materializedclj

(cte-materialized rel is-materialized)
source

(cte-search rel search-type col-name virtual-col-name)
source

cte-search-breadth-firstclj

(cte-search-breadth-first rel col-name virtual-col-name)
source

cte-search-depth-firstclj

(cte-search-depth-first rel col-name virtual-col-name)
source

Deletableclj

source

distinctclj

(distinct rel)
(distinct rel distinct-expression)

Adds a distinct or distinct on clause.

Adds a distinct or distinct on clause.
sourceraw docstring

ensure-join-alias-on-projectionclj

(ensure-join-alias-on-projection join-alias join-projection)
source

ex-info-missing-columnclj

(ex-info-missing-column rel node)
source

exceptclj

(except rel other-rel)

Creates a relation that is a combination of two relations with the EXCEPT operator

Creates a relation that is a combination of two relations with the EXCEPT operator
sourceraw docstring

extendclj

(extend rel col-name extend-expression)

Extends a relation with a computed column. This column will be automatically selected. Expression can reference previously extended columns by name:

(-> rel
  (extend :upper-name [:upper :name])
  (extend :lower-upper-name [:lower :upper-name]))

You can use reference these columns in any other value expression, and Penkala will correctly compile them in the generated SQL.

(-> rel
  (extend :upper-name [:upper :name])
  (extend :lower-upper-name [:lower :upper-name])
  (where [:= :lower-upper-name "FOO"]))
Extends a relation with a computed column. This column will be automatically selected. Expression can reference
previously extended columns by name:

```
(-> rel
  (extend :upper-name [:upper :name])
  (extend :lower-upper-name [:lower :upper-name]))
```

You can use reference these columns in any other value expression, and Penkala will correctly compile them in the
generated SQL.

```
(-> rel
  (extend :upper-name [:upper :name])
  (extend :lower-upper-name [:lower :upper-name])
  (where [:= :lower-upper-name "FOO"]))
```
sourceraw docstring

extend-with-aggregateclj

(extend-with-aggregate rel col-name agg-expression)

Extends the relation with a computed column that is an aggregate value (e.g. sum, max, min...). Root value expression must be a function. Penkala doesn't have any explicit support for the built in aggregate functions which means you can use whatever your DB supports, including custom aggregate functions.

If an aggregate column is selected, Penkala will automatically add a GROUP BY clause to the generated SQL.

(extend-with-aggregate rel :count [:count 1])

This column will be automatically selected.

Extends the relation with a computed column that is an aggregate value (e.g. sum, max, min...). Root value expression
must be a function. Penkala doesn't have any explicit support for the built in aggregate functions which means you can
use whatever your DB supports, including custom aggregate functions.

If an aggregate column is selected, Penkala will automatically add a GROUP BY clause to the generated SQL.

```
(extend-with-aggregate rel :count [:count 1])
```

This column will be automatically selected.
sourceraw docstring

extend-with-windowclj

(extend-with-window rel col-name window-expression)
(extend-with-window rel col-name window-expression partitions)
(extend-with-window rel col-name window-expression partitions orders)

Extends a relation with a window function column.

Extends a relation with a window function column.
sourceraw docstring

extract-fieldsclj

source

fetchclj

(fetch rel fetch)

Sets the fetch parameter.

Sets the fetch parameter.
sourceraw docstring

fromclj

(from updatable from-rel from-alias)
source

full-joinclj

(full-join rel join-rel join-alias join-on)
(full-join rel join-rel join-alias join-on join-projection)
source

get-delete-queryclj

(get-delete-query deletable env params)
source

get-insert-queryclj

(get-insert-query insertable env)
source

get-projected-columnsclj

(get-projected-columns rel)
(get-projected-columns acc rel path-prefix)
source

get-select-queryclj

(get-select-query rel env)
(get-select-query rel env params)
source

get-update-queryclj

(get-update-query updatable env params)
source

group-byclj

(group-by rel group-by-clause)

Explicit GROUP BY. Penkala can infer a default GROUP BY expression, so this is not needed in most cases, but you can use it if you want to override the default behavior. Use this function if you want to GROUP BY GROUPING SETS, ROLLUP or CUBE

Explicit GROUP BY. Penkala can infer a default GROUP BY expression, so this is not needed in most cases, but you can use it if you want to override the default behavior.
Use this function if you want to GROUP BY GROUPING SETS, ROLLUP or CUBE
sourceraw docstring

havingclj

(having rel having-expression)

And having operation. If there's already a having clause set, this clause will be joined with AND

And having operation. If there's already a having clause set, this clause will be joined with AND
sourceraw docstring

IDeletablecljprotocol

-usingclj

(-using this using-rel using-alias)
source

IInsertablecljprotocol

-on-conflict-doclj

(-on-conflict-do this action conflicts update where-expression)

-with-insertsclj

(-with-inserts this inserts)
source

inner-joinclj

(inner-join rel join-rel join-alias join-on)
(inner-join rel join-rel join-alias join-on join-projection)
source

inner-lateral-joinclj

(inner-lateral-join rel join-rel join-alias join-on)
(inner-lateral-join rel join-rel join-alias join-on join-projection)
source

Insertableclj

source

intersectclj

(intersect rel other-rel)

Creates a relation that is a combination of two relations with the INTERSECT operator

Creates a relation that is a combination of two relations with the INTERSECT operator
sourceraw docstring

IOnlycljprotocol

-onlyclj

(-only this is-only)
source

IRelationcljprotocol

-fetchclj

(-fetch this fetch)

-order-byclj

(-order-by this orders)

-extend-with-windowclj

(-extend-with-window this col-name window-expression partitions orders)

-distinctclj

(-distinct this distinct-expression)

-renameclj

(-rename this prev-col-name next-col-name)

-joinclj

(-join this join-type join-rel join-alias join-on join-projection)

-unionclj

(-union this other-rel)

-selectclj

(-select this projection)

-union-allclj

(-union-all this other-rel)

-with-parentclj

(-with-parent this parent)

-extendclj

(-extend this col-name extend-expression)

-intersectclj

(-intersect this other-rel)

-or-havingclj

(-or-having this having-expression)

-offsetclj

(-offset this offset)

-havingclj

(-having this having-expression)

-exceptclj

(-except this other-rel)

-group-byclj

(-group-by this group-by-clause)

-wrapclj

(-wrap this)

-extend-with-aggregateclj

(-extend-with-aggregate this col-name agg-expression)

-lockclj

(-lock this lock-type locked-rows)
source

IUpdatablecljprotocol

-fromclj

(-from this from-rel from-alias)

-with-updatesclj

(-with-updates this updates)
source

IWherecljprotocol

-or-whereclj

(-or-where this where-expression)

-whereclj

(-where this where-expression)
source

IWriteablecljprotocol

-returningclj

(-returning this projection)
source

joinclj

(join rel join-type join-rel join-alias join-on)
(join rel join-type join-rel join-alias join-on join-projection)

Joins another relation. Supported join types are:

  • :inner
  • :inner-lateral
  • :left
  • :left-lateral
  • :right
  • :full
  • :cross

When joining a relation, columns from the joined relation must be referenced with a namespaced key. Key's namespace will be the join alias (e.g. :join-alias/column). If you need to reference a column that's deeply joined, you can use join aliases concatenated with a dot (e.g. :join-alias.another-join-alias/column)

join-on can be any value expression, so you can have as complex join predicates as you need.

Joins another relation. Supported join types are:

- :inner
- :inner-lateral
- :left
- :left-lateral
- :right
- :full
- :cross

When joining a relation, columns from the joined relation must be referenced with a namespaced key. Key's namespace
will be the join alias (e.g. :join-alias/column). If you need to reference a column that's deeply joined, you
can use join aliases concatenated with a dot (e.g. :join-alias.another-join-alias/column)

`join-on` can be any value expression, so you can have as complex join predicates as you need.
sourceraw docstring

left-joinclj

(left-join rel join-rel join-alias join-on)
(left-join rel join-rel join-alias join-on join-projection)
source

left-lateral-joinclj

(left-lateral-join rel join-rel join-alias join-on)
(left-lateral-join rel join-rel join-alias join-on join-projection)
source

limitclj

(limit rel limit)

Sets the fetch parameter. Equivalent to fetch, provided as a convenience

Sets the fetch parameter. Equivalent to `fetch`, provided as a convenience
sourceraw docstring

lockclj

(lock rel lock-type)
(lock rel lock-type locked-rows)

Lock selected rows

Lock selected rows
sourceraw docstring

make-combined-relations-specclj

(make-combined-relations-spec operator rel1 rel2)
source

normalize-operatorclj

(normalize-operator [op-type operator])
source

offsetclj

(offset rel offset)

Sets the offset parameter

Sets the offset parameter
sourceraw docstring

on-conflict-do-nothingclj

(on-conflict-do-nothing insertable)
(on-conflict-do-nothing insertable conflicts)
(on-conflict-do-nothing insertable conflicts where-expression)
source

on-conflict-do-updateclj

(on-conflict-do-update insertable conflicts updates)
(on-conflict-do-update insertable conflicts updates where-expression)
source

OnConflictUpdatesclj

source

onlyclj

(only rel)
(only rel is-only)

Adds the only clause to limit the inheritance.

Adds the only clause to limit the inheritance.
sourceraw docstring

operationsclj

source

or-havingclj

(or-having rel having-expression)

Or having operation. If there's already a having clause set, this clause will be joined with OR

Or having operation. If there's already a having clause set, this clause will be joined with OR
sourceraw docstring

or-predicateclj

(or-predicate rel predicate-type predicate-expression)
source

or-whereclj

(or-where rel where-expression)

Or where operation. If there's already a where clause set, this clause will be joined with OR

Or where operation. If there's already a where clause set, this clause will be joined with OR
sourceraw docstring

order-byclj

(order-by rel orders)

Sets order by clause. It accepts a vector of columns by which the order will be performed. Columns can be either a keyword, or vectors if you need to use descending order or you want to set order for null values:

  • (order-by rel [:id])
  • (order-by rel [[:id :desc]])
  • (order-by rel [[:id :desc :nulls-first]])

You can reference columns in joined relations by using namespaced keys

Sets order by clause. It accepts a vector of columns by which the order will be performed. Columns can be either a
keyword, or vectors if you need to use descending order or you want to set order for null values:

- `(order-by rel [:id])`
- `(order-by rel [[:id :desc]])`
- `(order-by rel [[:id :desc :nulls-first]])`

You can reference columns in joined relations by using namespaced keys
sourceraw docstring

process-conflict-targetclj

(process-conflict-target insertable conflict-target)
source

process-group-byclj

(process-group-by rel group-by-clause)
source

process-insertsclj

(process-inserts inserts)
source

process-join-onclj

(process-join-on join-alias with-join join-on)
source

process-on-conflict-column-referencesclj

(process-on-conflict-column-references value)
source

process-on-conflict-updatesclj

(process-on-conflict-updates rel
                             {:keys [updates where] :as on-conflict-updates})
source

process-ordersclj

(process-orders rel orders)
source

process-projectionclj

(process-projection rel node-list)
source

process-value-expressionclj

(process-value-expression rel node)
source

rel->cteclj

(rel->cte cte-name rel)
source

Relationclj

source

renameclj

(rename rel prev-col-name next-col-name)

Renames a column. If you rename a column, you must use a new name to reference it after that

(-> rel
  (rename :name :product-name)
  (where [:= :product-name "FOO"]))
Renames a column. If you rename a column, you must use a new name to reference it after that

```
(-> rel
  (rename :name :product-name)
  (where [:= :product-name "FOO"]))
```
sourceraw docstring

resolve-columnclj

(resolve-column rel node)
source

resolve-columnsclj

(resolve-columns rel columns)
source

returningclj

(returning writeable projection)

Selects columns from the write operation (insert, update, delete)

Selects columns from the write operation (insert, update, delete)
sourceraw docstring

right-joinclj

(right-join rel join-rel join-alias join-on)
(right-join rel join-rel join-alias join-on join-projection)
source

selectclj

(select rel projection)

Selects columns from the relation. You can reference any extended columns here.

Selects columns from the relation. You can reference any extended columns here.
sourceraw docstring

spec->relationclj

(spec->relation spec-map)
source

throw-when-not-cte!clj

(throw-when-not-cte! rel)
source

unionclj

(union rel other-rel)

Creates a relation that is a combination of two relations with the UNION operator

Creates a relation that is a combination of two relations with the UNION operator
sourceraw docstring

union-allclj

(union-all rel other-rel)

Creates a relation that is a combination of two relations with the UNION ALL operator

Creates a relation that is a combination of two relations with the UNION ALL operator
sourceraw docstring

Updatableclj

source

usingclj

(using deletable using-rel using-alias)
source

whereclj

(where rel where-expression)

And where operation. If there's already a where clause set, this clause will be joined with AND. Accepts a value expression which can be nested as needed. You can reference a column in a joined relation by using namespaced keys:

(-> beta
   (r/join :inner alpha :alpha [:= :alpha-id :alpha/id])
   (r/where [:= :alpha/id 3]))

In this example :alpha/id is referencing the :id column in the relation joined with the :alpha alias.

And where operation. If there's already a where clause set, this clause will be joined with AND. Accepts a value
expression which can be nested as needed. You can reference a column in a joined relation by using namespaced keys:

```
(-> beta
   (r/join :inner alpha :alpha [:= :alpha-id :alpha/id])
   (r/where [:= :alpha/id 3]))
```

In this example `:alpha/id` is referencing the `:id` column in the relation joined with the `:alpha` alias.
sourceraw docstring

with-default-columnsclj

(with-default-columns rel)
source

with-default-pkclj

(with-default-pk rel)
source

with-default-projectionclj

(with-default-projection rel)
source

with-insertsclj

(with-inserts insertable inserts)
source

with-parentclj

(with-parent rel parent)
source

with-pkclj

(with-pk rel pk-cols)
source

with-updatesclj

(with-updates updatable updates)
source

wrapclj

(wrap rel)

Wraps a relation, so the original structure is not visible to other relations. Use this in rare cases where you want to force a sub-select wrap around the relation. There are very rare cases when this is needed, but for instance if you want to have a relation that is joined with other relations, and you want to select only one field, you will need to explicitly wrap that relation.

Wraps a relation, so the original structure is not visible to other relations. Use this in rare cases where you
want to force a sub-select wrap around the relation. There are very rare cases when this is needed, but for instance
if you want to have a relation that is joined with other relations, and you want to select only one field, you will
need to explicitly wrap that relation.
sourceraw docstring

Wrappedclj

source

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

× close