You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-21Lines changed: 21 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -33,35 +33,35 @@ The connection pool is closed with `close-db!`. This closes all open connections
33
33
34
34
## Running SQL queries
35
35
36
-
Queries are executed with callback-based functions `query!``insert!``update!``execute!` and [`core.async`](https://github.com/clojure/core.async)channel-based functions `<query!``<insert!``<update!``<execute!`.
36
+
Queries are executed with functions `query!``insert!``update!``execute!`. All functions have two arities that use either callbacks or a[`core.async`](https://github.com/clojure/core.async)channels.
37
37
38
-
Channel-based functions return a channel where query result or exception is put.
38
+
Channel-based functions return a channel where either query result or exception is put.
39
39
40
40
### execute! and query!
41
41
42
-
All other query functions delegate to `execute!`. This takes a db, a vector of sql string and parameters plus a callback with arity of two.
42
+
All other query functions delegate to `execute!`. This takes a db and a seq of sql followed by optional parameters.
43
43
44
44
```clojure
45
-
;; callback
46
-
(execute! db ["select $1::text""hello world"] (fn [rs err]
47
-
(println rs err))
48
-
; nil
49
-
50
45
;; async channel
51
-
(<!! (<execute! db ["select name, price from products where id = $1"1001]))
46
+
(<!! (execute! db ["select name, price from products where id = $1"1001]))
0 commit comments