Indentation clean up; note master docs ahead of released docs
This commit is contained in:
parent
e236b00cdd
commit
714d79a543
2 changed files with 10 additions and 8 deletions
|
|
@ -8,7 +8,7 @@ The latest versions on Clojars and on cljdoc:
|
||||||
|
|
||||||
[](https://clojars.org/seancorfield/next.jdbc) [](https://cljdoc.org/d/seancorfield/next.jdbc/CURRENT)
|
[](https://clojars.org/seancorfield/next.jdbc) [](https://cljdoc.org/d/seancorfield/next.jdbc/CURRENT)
|
||||||
|
|
||||||
This documentation is for the 1.0.10 release -- [see the CHANGELOG](CHANGELOG.md).
|
This documentation is for **master** after the 1.0.10 release -- [see the CHANGELOG](CHANGELOG.md).
|
||||||
|
|
||||||
* [Getting Started](/doc/getting-started.md)
|
* [Getting Started](/doc/getting-started.md)
|
||||||
* [Migrating from `clojure.java.jdbc`](/doc/migration-from-clojure-java-jdbc.md)
|
* [Migrating from `clojure.java.jdbc`](/doc/migration-from-clojure-java-jdbc.md)
|
||||||
|
|
|
||||||
|
|
@ -76,12 +76,14 @@ Assuming you have some logging library available in your application, such as [t
|
||||||
|
|
||||||
```clojure
|
```clojure
|
||||||
(def ds (mw/wrapper (jdbc/get-datasource db-spec)
|
(def ds (mw/wrapper (jdbc/get-datasource db-spec)
|
||||||
{:pre-process-fn (fn [sql-p opts]
|
{:pre-process-fn
|
||||||
(logger/info "About to execute" sql-p)
|
(fn [sql-p opts]
|
||||||
[sql-p opts])
|
(logger/info "About to execute" sql-p)
|
||||||
:rs!-fn (fn [rs opts]
|
[sql-p opts])
|
||||||
(logger/info "=>" (count rs) "rows")
|
:rs!-fn
|
||||||
rs)}))
|
(fn [rs opts]
|
||||||
|
(logger/info "=>" (count rs) "rows")
|
||||||
|
rs)}))
|
||||||
|
|
||||||
(jdbc/execute! ds ["select * from fruit"])
|
(jdbc/execute! ds ["select * from fruit"])
|
||||||
;; should produce log output like:
|
;; should produce log output like:
|
||||||
|
|
@ -111,7 +113,7 @@ Because the pre- and post-process hooks can modify the options hash map that is
|
||||||
(logger/info "SQL took" (- (::end opts) (::start opts)) "ms,"
|
(logger/info "SQL took" (- (::end opts) (::start opts)) "ms,"
|
||||||
"build took" (- build-time (::end opts)) "ms,"
|
"build took" (- build-time (::end opts)) "ms,"
|
||||||
"for" (first (:next.jdbc/sql-params opts))))
|
"for" (first (:next.jdbc/sql-params opts))))
|
||||||
rs)}))
|
rs)}))
|
||||||
|
|
||||||
(jdbc/execute! ds ["select * from fruit"])
|
(jdbc/execute! ds ["select * from fruit"])
|
||||||
;; should produce log output like:
|
;; should produce log output like:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue