PostgreSQL IN/= ANY(?) test

Hopefully documentation to come!
This commit is contained in:
Sean Corfield 2019-09-04 18:43:30 -07:00
parent 525350e155
commit 296cd51aa5
3 changed files with 9 additions and 2 deletions

View file

@ -6,7 +6,7 @@ Only accretive/fixative changes will be made from now on.
The following changes have been committed to the **master** branch since the 1.0.6 release: The following changes have been committed to the **master** branch since the 1.0.6 release:
* None. * Added test for using `any(?)` and arrays in PostgreSQL for `IN (?,,,?)` style queries. Documentation to follow once I figure out where that belongs!
## Stable Builds ## Stable Builds

View file

@ -17,7 +17,9 @@
com.opentable.components/otj-pg-embedded {:mvn/version "0.13.1"} com.opentable.components/otj-pg-embedded {:mvn/version "0.13.1"}
com.impossibl.pgjdbc-ng/pgjdbc-ng {:mvn/version "0.8.2"} com.impossibl.pgjdbc-ng/pgjdbc-ng {:mvn/version "0.8.2"}
org.xerial/sqlite-jdbc {:mvn/version "3.28.0"} org.xerial/sqlite-jdbc {:mvn/version "3.28.0"}
com.microsoft.sqlserver/mssql-jdbc {:mvn/version "7.2.2.jre8"}}} com.microsoft.sqlserver/mssql-jdbc {:mvn/version "7.2.2.jre8"}
;; supplementary test stuff
org.slf4j/slf4j-nop {:mvn/version "1.7.28"}}}
:runner :runner
{:extra-deps {com.cognitect/test-runner {:extra-deps {com.cognitect/test-runner
{:git/url "https://github.com/cognitect-labs/test-runner" {:git/url "https://github.com/cognitect-labs/test-runner"

View file

@ -197,3 +197,8 @@
(sql/find-by-keys (ds) :fruit (sql/find-by-keys (ds) :fruit
{:name "Apple"} {:name "Apple"}
{:order-by []})))) {:order-by []}))))
(deftest array-in
(when (postgres?)
(let [data (sql/find-by-keys (ds) :fruit ["id = any(?)" (int-array [1 2 3 4])])]
(is (= 4 (count data))))))