8000 Fixes #22: Boolean not supported by default · alaisi/postgres.async@049a508 · GitHub
[go: up one dir, main page]

Skip to content

Commit 049a508

Browse files
committed
Fixes #22: Boolean not supported by default
1 parent 7ecbf5c commit 049a508

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
:url "http://github.com/alaisi/postgres.async.git"}
88
:dependencies [[org.clojure/clojure "1.6.0"]
99
[org.clojure/core.async "0.2.374"]
10-
[com.github.alaisi.pgasync/postgres-async-driver "0.7"]
10+
[com.github.alaisi.pgasync/postgres-async-driver "0.8-SNAPSHOT"]
1111
[cheshire "5.5.0" :scope "provided"]]
1212
:lein-release {:deploy-via :clojars}
1313
:global-vars {*warn-on-reflection* true}

test/postgres/async_test.clj

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@
4040

4141
(testing "query returns rows as map"
4242
(let [rs (wait (query! *db* ["select 1 as x"]))]
43-
(is (= 1 (get-in rs [0 :x]))))))
43+
(is (= 1 (get-in rs [0 :x])))))
44+
45+
(testing "query returns oid bool as boolean"
46+
(let [rs (wait (query! *db* ["select true as b"]))]
47+
(is (= true (get-in rs [0 :b]))))))
4448

4549
(deftest query-for-array
4650

@@ -50,7 +54,11 @@
5054

5155
(testing "nested arrays are converted to vectors"
5256
(let [rs (wait (query! *db* ["select '{{1,2},{3,4},{5,NULL}}'::INT[][] as a"]))]
53-
(is (= [[1 2] [3 4] [5 nil]] (get-in rs [0 :a]))))))
57+
(is (= [[1 2] [3 4] [5 nil]] (get-in rs [0 :a])))))
58+
59+
(testing "bool arrays are converted to boolean vectors"
60+
(let [rs (wait (query! *db* ["select '{true,false}'::BOOL[] as b"]))]
61+
(is (= [true false] (get-in rs [0 :b]))))))
5462

5563
(deftest query-for-rows
5664

0 commit comments

Comments
 (0)
0