Implementation of insert!.
Implementation of [[insert!]].
(insert! modelable row-or-rows)(insert! modelable columns row-vectors)(insert! modelable k v & more)Returns number of rows inserted.
Returns number of rows inserted.
(insert-returning-instances! modelable row-or-rows)(insert-returning-instances! [modelable & columns-to-return] row-or-rows)(insert-returning-instances! modelable columns row-vectors)(insert-returning-instances! [modelable & columns-to-return]
columns
row-vectors)(insert-returning-instances! modelable k v & more)(insert-returning-instances! [modelable & columns-to-return] k v & more)Like insert!, but returns a vector of the primary keys of the newly inserted rows rather than the number of rows
inserted. The primary keys are determined by model/primary-keys. For models with a single primary key, this
returns a vector of single values, e.g. [1 2] if the primary key is :id and you've inserted rows 1 and 2; for
composite primary keys this returns a vector of tuples where each tuple has the value of corresponding primary key as
returned by model/primary-keys, e.g. for composite PK [:id :name] you might get [[1 "Cam"] [2 "Sam"]].
Like [[insert!]], but returns a vector of the primary keys of the newly inserted rows rather than the number of rows inserted. The primary keys are determined by [[model/primary-keys]]. For models with a single primary key, this returns a vector of single values, e.g. `[1 2]` if the primary key is `:id` and you've inserted rows 1 and 2; for composite primary keys this returns a vector of tuples where each tuple has the value of corresponding primary key as returned by [[model/primary-keys]], e.g. for composite PK `[:id :name]` you might get `[[1 "Cam"] [2 "Sam"]]`.
(insert-returning-pks! modelable row-or-rows)(insert-returning-pks! modelable columns row-vectors)(insert-returning-pks! modelable k v & more)Like insert!, but returns a vector of the primary keys of the newly inserted rows rather than the number of rows
inserted. The primary keys are determined by model/primary-keys. For models with a single primary key, this
returns a vector of single values, e.g. [1 2] if the primary key is :id and you've inserted rows 1 and 2; for
composite primary keys this returns a vector of tuples where each tuple has the value of corresponding primary key as
returned by model/primary-keys, e.g. for composite PK [:id :name] you might get [[1 "Cam"] [2 "Sam"]].
Like [[insert!]], but returns a vector of the primary keys of the newly inserted rows rather than the number of rows inserted. The primary keys are determined by [[model/primary-keys]]. For models with a single primary key, this returns a vector of single values, e.g. `[1 2]` if the primary key is `:id` and you've inserted rows 1 and 2; for composite primary keys this returns a vector of tuples where each tuple has the value of corresponding primary key as returned by [[model/primary-keys]], e.g. for composite PK `[:id :name]` you might get `[[1 "Cam"] [2 "Sam"]]`.
(reducible-insert modelable row-or-rows)(reducible-insert modelable columns row-vectors)(reducible-insert modelable k v & more)(reducible-insert-returning-instances modelable row-or-rows)(reducible-insert-returning-instances [modelable & columns-to-return]
row-or-rows)(reducible-insert-returning-instances modelable columns row-vectors)(reducible-insert-returning-instances [modelable & columns-to-return]
columns
row-vectors)(reducible-insert-returning-instances modelable k v & more)(reducible-insert-returning-instances [modelable & columns-to-return]
k
v
&
more)(reducible-insert-returning-pks modelable row-or-rows)(reducible-insert-returning-pks modelable columns row-vectors)(reducible-insert-returning-pks modelable k v & more)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 |