(->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
(->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
(->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
(cross-join rel join-rel join-alias)
(cross-join rel join-rel join-alias join-projection)
(distinct rel)
(distinct rel distinct-expression)
Adds a distinct or distinct on clause.
Adds a distinct or distinct on clause.
(ensure-join-alias-on-projection join-alias join-projection)
(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
(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"])) ```
(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.
(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.
(full-join rel join-rel join-alias join-on)
(full-join rel join-rel join-alias join-on join-projection)
(get-projected-columns rel)
(get-projected-columns acc rel path-prefix)
(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
(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
(-on-conflict-do this action conflicts update where-expression)
(-with-inserts this inserts)
(inner-join rel join-rel join-alias join-on)
(inner-join rel join-rel join-alias join-on join-projection)
(inner-lateral-join rel join-rel join-alias join-on)
(inner-lateral-join rel join-rel join-alias join-on join-projection)
(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
(-fetch this fetch)
(-order-by this orders)
(-extend-with-window this col-name window-expression partitions orders)
(-distinct this distinct-expression)
(-rename this prev-col-name next-col-name)
(-join this join-type join-rel join-alias join-on join-projection)
(-union this other-rel)
(-select this projection)
(-union-all this other-rel)
(-with-parent this parent)
(-extend this col-name extend-expression)
(-intersect this other-rel)
(-or-having this having-expression)
(-offset this offset)
(-having this having-expression)
(-except this other-rel)
(-group-by this group-by-clause)
(-wrap this)
(-extend-with-aggregate this col-name agg-expression)
(-lock this lock-type locked-rows)
(-from this from-rel from-alias)
(-with-updates this updates)
(-or-where this where-expression)
(-where this where-expression)
(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:
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.
(left-join rel join-rel join-alias join-on)
(left-join rel join-rel join-alias join-on join-projection)
(left-lateral-join rel join-rel join-alias join-on)
(left-lateral-join rel join-rel join-alias join-on join-projection)
(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
(lock rel lock-type)
(lock rel lock-type locked-rows)
Lock selected rows
Lock selected rows
(on-conflict-do-nothing insertable)
(on-conflict-do-nothing insertable conflicts)
(on-conflict-do-nothing insertable conflicts where-expression)
(on-conflict-do-update insertable conflicts updates)
(on-conflict-do-update insertable conflicts updates where-expression)
(only rel)
(only rel is-only)
Adds the only clause to limit the inheritance.
Adds the only clause to limit the inheritance.
(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
(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
(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
(process-on-conflict-updates rel
{:keys [updates where] :as on-conflict-updates})
(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"])) ```
(returning writeable projection)
Selects columns from the write operation (insert, update, delete)
Selects columns from the write operation (insert, update, delete)
(right-join rel join-rel join-alias join-on)
(right-join rel join-rel join-alias join-on join-projection)
(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.
(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
(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
(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.
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close