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

->writeableclj

(->writeable constructor rel)

-writeable-returningclj

(-writeable-returning rel projection)

all-operationsclj


and-predicateclj

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

Deletableclj


distinctclj

(distinct rel)
(distinct rel distinct-expression)

Adds a distinct or distinct on clause.

Adds a distinct or distinct on clause.
raw docstring

ex-info-missing-columnclj

(ex-info-missing-column rel node)

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
raw 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"]))
```
raw 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.
raw 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.
raw docstring

extract-operatorclj

(extract-operator [op-type operator])

fromclj

(from updatable from-rel from-alias)

get-delete-queryclj

(get-delete-query deletable env params)

get-insert-queryclj

(get-insert-query insertable env data)

get-projected-columnsclj

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

get-select-queryclj

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

get-update-queryclj

(get-update-query updatable env params)

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

IDeletablecljprotocol

-usingclj

(-using this using-rel using-alias)

IInsertablecljprotocol

-on-conflict-doclj

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

Insertableclj


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

IOnlycljprotocol

-onlyclj

(-only this is-only)

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)

-lockclj

(-lock this lock-type locked-rows)

IUpdatablecljprotocol

-fromclj

(-from this from-rel from-alias)

-with-updatesclj

(-with-updates this updates)

IWherecljprotocol

-or-whereclj

(-or-where this where-expression)

-whereclj

(-where this where-expression)

IWriteablecljprotocol

-returningclj

(-returning this projection)

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.
raw docstring

limitclj

(limit rel limit)

Sets the limit parameter.

Sets the limit parameter.
raw docstring

lockclj

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

Lock selected rows

Lock selected rows
raw docstring

make-combined-relations-specclj

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

offsetclj

(offset rel offset)

Sets the offset parameter

Sets the offset parameter
raw docstring

on-conflict-do-nothingclj

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

on-conflict-do-updateclj

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

onlyclj

(only rel)
(only rel is-only)

Adds the only clause to limit the inheritance.

Adds the only clause to limit the inheritance.
raw docstring

operationsclj


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

or-predicateclj

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

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

process-conflict-targetclj

(process-conflict-target insertable conflict-target)

process-on-conflict-column-referencesclj

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

process-ordersclj

(process-orders rel orders)

process-projectionclj

(process-projection rel node-list)

process-value-expressionclj

(process-value-expression rel node)

Relationclj


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"]))
```
raw docstring

resolve-columnclj

(resolve-column rel node)

resolve-columnsclj

(resolve-columns rel columns)

returningclj

(returning writeable projection)

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

Selects columns from the write operation (insert, update, delete)
raw 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.
raw docstring

spec->relationclj

(spec->relation spec-map)

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

Updatableclj


usingclj

(using deletable using-rel using-alias)

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.
raw docstring

with-default-columnsclj

(with-default-columns rel)

with-default-pkclj

(with-default-pk rel)

with-default-projectionclj

(with-default-projection rel)

with-parentclj

(with-parent rel parent)

with-pkclj

(with-pk rel pk-cols)

with-updatesclj

(with-updates updatable updates)

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.
raw docstring

Wrappedclj

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

× close