Implementation of delete!.
Code for building Honey SQL for DELETE lives in toucan2.honeysql2
Implementation of [[delete!]]. Code for building Honey SQL for DELETE lives in [[toucan2.honeysql2]]
(delete! modelable & conditions? queryable?)(delete! :conn connectable modelable & conditions? queryable?)Delete instances of a model that match conditions or a queryable. Returns the number of rows deleted.
;; delete a row by primary key
(t2/delete! :models/venues 1)
;; Delete all rows matching a condition
(t2/delete! :models/venues :name "Bird Store")
Allowed syntax is identical to toucan2.select/select, including optional positional parameters like :conn;
see toucan2.query/parse-args and the :toucan2.query/default-args spec.
Delete instances of a model that match `conditions` or a `queryable`. Returns the number of rows deleted. ```clj ;; delete a row by primary key (t2/delete! :models/venues 1) ;; Delete all rows matching a condition (t2/delete! :models/venues :name "Bird Store") ``` Allowed syntax is identical to [[toucan2.select/select]], including optional positional parameters like `:conn`; see [[toucan2.query/parse-args]] and the `:toucan2.query/default-args` spec.
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 |