Liking cljdoc? Tell your friends :D

toucan2.operation

Common/shared code for implementing operations like the code in toucan2.insert or toucan2.update.

Common/shared code for implementing operations like the code in [[toucan2.insert]] or [[toucan2.update]].
raw docstring

reducible-returning-instancesclj

(reducible-returning-instances query-type unparsed-args)

Helper wrapper for reducible-returning-instances* that also resolves model and parses unparsed-args.

Helper wrapper for [[reducible-returning-instances*]] that also resolves `model` and parses `unparsed-args`.
sourceraw docstring

reducible-returning-instances*clj

(reducible-returning-instances* query-type model parsed-args)

Given parsed-args, return a reducible that yields rows of model, as toucan2.instance maps.

The default implementation builds a reducible that combines a reducible-update-returning-pks* and [[->ReducibleReturningInstancesFromPKs]].

Dispatches off of [query-type model].

Given `parsed-args`, return a reducible that yields rows of `model`, as [[toucan2.instance]] maps.

The default implementation builds a reducible that combines a [[reducible-update-returning-pks*]]
and [[->ReducibleReturningInstancesFromPKs]].

Dispatches off of `[query-type model]`.
sourceraw docstring

reducible-updateclj

(reducible-update query-type unparsed-args)
source

reducible-update*clj

(reducible-update* query-type model parsed-args)

Return a reducible query based on parsed-args. This should return either an update count (number of rows updated) or a sequence of PK values for affected rows; which of these gets returned depends on [[toucan2.jdbc.query/options]] (for the JDBC backend) or similar.

This is "update" in the sense that it is something that updates the database and returns an update count -- it could mean a SQL UPDATE, INSERT, or DELETE.

Return a reducible query based on `parsed-args`. This should return either an update count (number of rows updated) or
a sequence of PK values for affected rows; which of these gets returned depends on [[toucan2.jdbc.query/options]] (for
the JDBC backend) or similar.

This is "update" in the sense that it is something that updates the database and returns an update count -- it could
mean a SQL `UPDATE`, `INSERT`, or `DELETE`.
sourceraw docstring

reducible-update-returning-pksclj

(reducible-update-returning-pks query-type unparsed-args)

Helper wrapper for reducible-update-returning-pks* that also resolves modelable and parses unparsed-args.

Helper wrapper for [[reducible-update-returning-pks*]] that also resolves `modelable` and parses `unparsed-args`.
sourceraw docstring

reducible-update-returning-pks*clj

(reducible-update-returning-pks* query-type model parsed-args)

Given parsed-args return a reducible that when reduced yields a sequence of PK values for affected rows. Each PK value should be a plain value for rows with a single primary key, e.g. an integer for a row with an integer :id column, or a vector of primary key values in the same order as toucan2.model/primary-keys for models with composite primary keys.

The default implementation combines reducible-update* with return-pks-eduction.

Given `parsed-args` return a reducible that when reduced yields a sequence of PK values for affected rows. Each PK
value should be a plain value for rows with a single primary key, e.g. an integer for a row with an integer `:id`
column, or a vector of primary key values in the same order as [[toucan2.model/primary-keys]] for models with
composite primary keys.

The default implementation combines [[reducible-update*]] with [[return-pks-eduction]].
sourceraw docstring

return-pks-eductionclj

(return-pks-eduction model reducible-operation)

Given a reducible-operation returning whatever (presumably returning affected row counts) wrap it in an eduction and in [[toucan2.execute/->WithReturnKeys]] so it returns a sequence of primary key vectors.

Given a `reducible-operation` returning whatever (presumably returning affected row counts) wrap it in an eduction and
in [[toucan2.execute/->WithReturnKeys]] so it returns a sequence of primary key vectors.
sourceraw docstring

returning-instancesclj

(returning-instances query-type unparsed-args)

Helper wrapper for reducible-returning-instances that also fully realizes the reducible it returns.

Helper wrapper for [[reducible-returning-instances]] that also fully realizes the reducible it returns.
sourceraw docstring

returning-update-count!clj

(returning-update-count! query-type unparsed-args)
source

select-reducible-with-pksclj

(select-reducible-with-pks model columns row-pks)

Return a reducible that returns instances of model that match a sequence of PKs. Each PK should be either a single value or vector of values (for models with a composite PK). This is used to implement the default implementation of reducible-returning-instances*.

row-pks should be exactly as they come back from the DB -- not transformed in any way.

Return a reducible that returns instances of `model` that match a sequence of PKs. Each PK should be either a single
value or vector of values (for models with a composite PK). This is used to implement the default implementation
of [[reducible-returning-instances*]].

`row-pks` should be exactly as they come back from the DB -- not transformed in any way.
sourceraw docstring

update-returning-pks!clj

(update-returning-pks! query-type unparsed-args)

Helper wrapper for reducible-update-returning-pks that also fully realizes the results.

Helper wrapper for [[reducible-update-returning-pks]] that also fully realizes the results.
sourceraw docstring

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

× close