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* 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.
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.
(reducible-returning-instances query-type modelable-columns 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-returning-pks*
and [[->ReducibleReturningInstancesFromPKs]].
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-returning-pks*]] and [[->ReducibleReturningInstancesFromPKs]].
(reducible-returning-pks query-type modelable unparsed-args)
Helper wrapper for reducible-returning-pks*
that also resolves modelable
and parses unparsed-args
.
Helper wrapper for [[reducible-returning-pks*]] that also resolves `modelable` and parses `unparsed-args`.
(reducible-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*
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*]] 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 [[->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 [[->WithReturnKeys]] so it returns a sequence of primary key vectors.
(returning-instances! query-type modelable-columns 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.
(returning-pks! query-type modelable unparsed-args)
Helper wrapper for reducible-returning-pks
that also fully realizes the results.
Helper wrapper for [[reducible-returning-pks]] that also fully realizes the results.
(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*
.
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*]].
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close