Add BOOLEAN to SQLite Tips & Tricks example for #134
This commit is contained in:
parent
583aa5b545
commit
0fcbfcdc74
2 changed files with 3 additions and 1 deletions
|
|
@ -364,7 +364,7 @@ You can work around this using a builder that handles reading the column directl
|
||||||
(fn [builder ^ResultSet rs ^Integer i]
|
(fn [builder ^ResultSet rs ^Integer i]
|
||||||
(let [rsm ^ResultSetMetaData (:rsmeta builder)]
|
(let [rsm ^ResultSetMetaData (:rsmeta builder)]
|
||||||
(rs/read-column-by-index
|
(rs/read-column-by-index
|
||||||
(if (#{"BIT" "BOOL"} (.getColumnTypeName rsm i))
|
(if (#{"BIT" "BOOL" "BOOLEAN"} (.getColumnTypeName rsm i))
|
||||||
(.getBoolean rs i)
|
(.getBoolean rs i)
|
||||||
(.getObject rs i))
|
(.getObject rs i))
|
||||||
rsm
|
rsm
|
||||||
|
|
|
||||||
|
|
@ -347,6 +347,8 @@ VALUES ('Pear', 'green', 49, 47)
|
||||||
(fn [builder ^ResultSet rs ^Integer i]
|
(fn [builder ^ResultSet rs ^Integer i]
|
||||||
(let [rsm ^ResultSetMetaData (:rsmeta builder)]
|
(let [rsm ^ResultSetMetaData (:rsmeta builder)]
|
||||||
(rs/read-column-by-index
|
(rs/read-column-by-index
|
||||||
|
;; we only use bit and bool for
|
||||||
|
;; sqlite (not boolean)
|
||||||
(if (#{"BIT" "BOOL"} (.getColumnTypeName rsm i))
|
(if (#{"BIT" "BOOL"} (.getColumnTypeName rsm i))
|
||||||
(.getBoolean rs i)
|
(.getBoolean rs i)
|
||||||
(.getObject rs i))
|
(.getObject rs i))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue