Code for executing queries and statements, and reducing their results.
Code for executing queries and statements, and reducing their results.
Thunk function to call every time a query is executed if with-call-count
is in use.
Thunk function to call every time a query is executed if [[with-call-count]] is in use.
(compile & body)
Return the compiled query that would be executed by a form, rather than executing that form itself.
(delete/delete :table :id 1) => ["DELETE FROM table WHERE ID = ?" 1]
Return the compiled query that would be executed by a form, rather than executing that form itself. (delete/delete :table :id 1) => ["DELETE FROM table WHERE ID = ?" 1]
(do-with-call-counts f)
Impl for with-call-count
macro; don't call this directly.
Impl for [[with-call-count]] macro; don't call this directly.
(query queryable)
(query connectable queryable)
(query connectable modelable queryable)
(query-one queryable)
(query-one connectable queryable)
(query-one connectable modelable queryable)
(reduce-compiled-query connectable model compiled-query rf init)
(reduce-compiled-query-with-connection conn model compiled-query rf init)
(reduce-uncompiled-query connectable model query rf init)
(reducible-query queryable)
(reducible-query connectable queryable)
(reducible-query connectable modelable queryable)
(with-call-count [call-count-fn-binding] & body)
Execute body
, trackingthe number of database queries and statements executed. This number can be fetched at any
time withing body
by calling function bound to call-count-fn-binding
:
(with-call-count [call-count] (select ...) (println "CALLS:" (call-count)) (insert! ...) (println "CALLS:" (call-count))) ;; -> CALLS: 1 ;; -> CALLS: 2
Execute `body`, trackingthe number of database queries and statements executed. This number can be fetched at any time withing `body` by calling function bound to `call-count-fn-binding`: (with-call-count [call-count] (select ...) (println "CALLS:" (call-count)) (insert! ...) (println "CALLS:" (call-count))) ;; -> CALLS: 1 ;; -> CALLS: 2
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close