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

->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

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

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)
(extend-with-aggregate rel col-name agg-expression agg-filter)

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-operatorclj

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

fromclj

(from updatable from-rel from-alias)
source

get-delete-queryclj

(get-delete-query deletable env params)
source

get-insert-queryclj

(get-insert-query insertable env data)
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

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

-limitclj

(-limit this limit)

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

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

-wrapclj

(-wrap this)

-extend-with-aggregateclj

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

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

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

limitclj

(limit rel limit)

Sets the limit parameter.

Sets the limit parameter.
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

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

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-on-conflict-column-referencesclj

(process-on-conflict-column-references value)
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

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

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

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-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