File tree 2 files changed +23
-0
lines changed
.clj-kondo/com.github.seancorfield/next.jdbc
hooks/com/github/seancorfield
2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ {:hooks
2
+ {:analyze-call
3
+ {next.jdbc/with-transaction
4
+ hooks.com.github.seancorfield.next-jdbc/with-transaction}}}
Original file line number Diff line number Diff line change
1
+ (ns hooks.com.github.seancorfield.next-jdbc
2
+ (:require
3
+ [clj-kondo.hooks-api :as api]))
4
+
5
+ (defn with-transaction
6
+ " Expands (with-transaction [tx expr opts] body)
7
+ to (let [tx expr] opts body) pre clj-kondo examples."
8
+ [{:keys [:node ]}]
9
+ (let [[binding-vec & body] (rest (:children node))
10
+ [sym val opts] (:children binding-vec)]
11
+ (when-not (and sym val)
12
+ (throw (ex-info " No sym and val provided" {})))
13
+ (let [new-node (api/list-node
14
+ (list*
15
+ (api/token-node 'let)
16
+ (api/vector-node [sym val])
17
+ opts
18
+ body))]
19
+ {:node new-node})))
You can’t perform that action at this time.
0 commit comments