Liking cljdoc? Tell your friends :D
Clojure only.

toucan2.delete

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]]
raw docstring

delete!clj

(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.
sourceraw docstring

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

× close