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]].
(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`.
(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]`.
(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`.
(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`.
(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]].
(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.
(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.
(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.
(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.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |