prep for 1.3.981; test against xtdb nightly

Signed-off-by: Sean Corfield <sean@corfield.org>
This commit is contained in:
Sean Corfield 2024-12-13 22:57:40 -08:00
parent 801e6c923b
commit b981357d47
No known key found for this signature in database
6 changed files with 28 additions and 30 deletions

View file

@ -2,7 +2,7 @@
Only accretive/fixative changes will be made from now on. Only accretive/fixative changes will be made from now on.
* 1.3.next in progress * 1.3.981 -- 2024-12-13
* Address [#291](https://github.com/seancorfield/next-jdbc/issues/291) by adding an XTDB section to **Tips & Tricks**. * Address [#291](https://github.com/seancorfield/next-jdbc/issues/291) by adding an XTDB section to **Tips & Tricks**.
* Added XTDB as a supported database for testing via PR [#290](https://github.com/seancorfield/next-jdbc/pull/290). _Note: not all features are tested against XTDB due to several fundamental differences in architecture, mostly around primary key/generated keys and lack of DDL operations (since XTDB is schemaless)._ * Added XTDB as a supported database for testing via PR [#290](https://github.com/seancorfield/next-jdbc/pull/290). _Note: not all features are tested against XTDB due to several fundamental differences in architecture, mostly around primary key/generated keys and lack of DDL operations (since XTDB is schemaless)._
* Update dev/test dependencies. * Update dev/test dependencies.

View file

@ -8,8 +8,8 @@ The next generation of `clojure.java.jdbc`: a new low-level Clojure wrapper for
The latest versions on Clojars and on cljdoc: The latest versions on Clojars and on cljdoc:
[![Clojars](https://img.shields.io/badge/clojars-com.github.seancorfield/next.jdbc_1.3.967-blue.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABjFBMVEUAAAAdCh0qDikdChwAAAAnDSY0EjM2FjUnDiYnDSYnDSYpDigyEDEEAQRGNUb///////8mDSYAAAAAAAAAAAAFAgUqEyoAAAAAAAAAAAAFAgUAAABXU1c2FjVMx+dQx+f///////9Nx+b////4/f6y4vRPt+RQtOT///9Qt+P///8oDSey4vRQr9/////3/P5hzelNx+dNx+dNx+f///8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YrMDI6MDBZSw2WAAAAAElFTkSuQmCC)](https://clojars.org/com.github.seancorfield/next.jdbc) [![Clojars](https://img.shields.io/badge/clojars-com.github.seancorfield/next.jdbc_1.3.981-blue.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABjFBMVEUAAAAdCh0qDikdChwAAAAnDSY0EjM2FjUnDiYnDSYnDSYpDigyEDEEAQRGNUb///////8mDSYAAAAAAAAAAAAFAgUqEyoAAAAAAAAAAAAFAgUAAABXU1c2FjVMx+dQx+f///////9Nx+b////4/f6y4vRPt+RQtOT///9Qt+P///8oDSey4vRQr9/////3/P5hzelNx+dNx+dNx+f///8AAAAuDy0zETIAAAAoDScAAAAAAAARBREAAAAvDy40ETMwEC9gSF+Ne42ilKKuoK6Rg5B5ZXlaP1o4Gzf///9nTWZ4YncyEDF/bn/8/Pz9/P339/c1FTUlDCRRM1AbCRtlS2QyEDEuDy1gRWAxEDAzETIwEC/g4OAvDy40EjOaiZorDiq9sbzNyM3UzdQyEDE0ETMzETKflZ/UzdQ5Fzmu4fNYyuhNx+dPt+RLu9xQyOhBbo81GTuW2vCo4PJNx+c4MFE5N1lHiLFEhKQyEDGDboMzETI5Fjh5bXje2d57aHrIw8jc2NyWhJUrDioxe9o4AAAAPnRSTlMAkf+IAQj9+e7n6e31RtqAD/QAAAED+A0ZEQ8DwvkLBsmcR4aG8+cdAD6C8/MC94eP+qoTrgH+/wj1HA8eEvpXOCUAAAABYktHRA8YugDZAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wcHFjou4Z/shwAAAUpJREFUOMul0/VTwzAUB/AAwyW4y3B3h8EDNuTh7u6UDHcd8I+TbHSjWdrjju/1h77kc+3Lu5aQvyakF/r6B5wu1+DQMEBomLRtG0EpozYDCEccA4iIjIqOiY0bB5iYxHgZ4FQCpYneKmmal0aQPMOXZnUAvJhLkbpInf8NFtKCTrGImK6DJcTlDGl/BXGV6oCsrSNIYAM3aQDwl2xJYBtBB5lZAuyYgWzY3YMcNcjN2wc4EGMEFTg8+hlyfgEenygAj71Q9FBExH0wKC4p1bRTJlJWXqEAVNM05ovbXfkPAHBmAUQPAGaAsXMBLiwA8z3h0gRcsWsObuAWLJu8Awb3ZoB5T8EvS/CgBo9Y5Z8TPwXBJwlUI9Ia/yRrEZ8lID71Olrf0MiamkkL4kurDEjba+C/e2sninR0wrsH8eMTvrqIWbodjh7jyjdtCY3Aniz4jwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNS0wNy0wN1QyMjo1ODo0NiswMjowMCgWtSoAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTUtMDctMDdUMjI6NTg6NDYrMDI6MDBZSw2WAAAAAElFTkSuQmCC)](https://clojars.org/com.github.seancorfield/next.jdbc)
[![cljdoc](https://cljdoc.org/badge/com.github.seancorfield/next.jdbc?1.3.967)](https://cljdoc.org/d/com.github.seancorfield/next.jdbc/CURRENT) [![cljdoc](https://cljdoc.org/badge/com.github.seancorfield/next.jdbc?1.3.981)](https://cljdoc.org/d/com.github.seancorfield/next.jdbc/CURRENT)
[![Slack](https://img.shields.io/badge/slack-next.jdbc-orange.svg?logo=slack)](https://clojurians.slack.com/app_redirect?channel=sql) [![Slack](https://img.shields.io/badge/slack-next.jdbc-orange.svg?logo=slack)](https://clojurians.slack.com/app_redirect?channel=sql)
[![Join Slack](https://img.shields.io/badge/slack-join_clojurians-orange.svg?logo=slack)](http://clojurians.net) [![Join Slack](https://img.shields.io/badge/slack-join_clojurians-orange.svg?logo=slack)](http://clojurians.net)
@ -20,7 +20,7 @@ The documentation on [cljdoc.org](https://cljdoc.org/d/com.github.seancorfield/n
* [Migrating from `clojure.java.jdbc`](https://cljdoc.org/d/com.github.seancorfield/next.jdbc/CURRENT/doc/migration-from-clojure-java-jdbc) * [Migrating from `clojure.java.jdbc`](https://cljdoc.org/d/com.github.seancorfield/next.jdbc/CURRENT/doc/migration-from-clojure-java-jdbc)
* Feedback via [issues](https://github.com/seancorfield/next-jdbc/issues) or in the [`#sql` channel on the Clojurians Slack](https://clojurians.slack.com/messages/C1Q164V29/) or the [`#sql` stream on the Clojurians Zulip](https://clojurians.zulipchat.com/#narrow/stream/152063-sql). * Feedback via [issues](https://github.com/seancorfield/next-jdbc/issues) or in the [`#sql` channel on the Clojurians Slack](https://clojurians.slack.com/messages/C1Q164V29/) or the [`#sql` stream on the Clojurians Zulip](https://clojurians.zulipchat.com/#narrow/stream/152063-sql).
The documentation on GitHub is for **develop** since the 1.3.967 release -- [see the CHANGELOG](https://github.com/seancorfield/next-jdbc/blob/develop/CHANGELOG.md) and then read the [corresponding updated documentation](https://github.com/seancorfield/next-jdbc/tree/develop/doc) on GitHub if you want. Older versions of `next.jdbc` were published under the `seancorfield` group ID and you can find [older seancorfield/next.jdbc documentation on cljdoc.org](https://cljdoc.org/versions/seancorfield/next.jdbc). The documentation on GitHub is for **develop** since the 1.3.981 release -- [see the CHANGELOG](https://github.com/seancorfield/next-jdbc/blob/develop/CHANGELOG.md) and then read the [corresponding updated documentation](https://github.com/seancorfield/next-jdbc/tree/develop/doc) on GitHub if you want. Older versions of `next.jdbc` were published under the `seancorfield` group ID and you can find [older seancorfield/next.jdbc documentation on cljdoc.org](https://cljdoc.org/versions/seancorfield/next.jdbc).
This project follows the version scheme MAJOR.MINOR.COMMITS where MAJOR and MINOR provide some relative indication of the size of the change, but do not follow semantic versioning. In general, all changes endeavor to be non-breaking (by moving to new names rather than by breaking existing names). COMMITS is an ever-increasing counter of commits since the beginning of this repository. This project follows the version scheme MAJOR.MINOR.COMMITS where MAJOR and MINOR provide some relative indication of the size of the change, but do not follow semantic versioning. In general, all changes endeavor to be non-breaking (by moving to new names rather than by breaking existing names). COMMITS is an ever-increasing counter of commits since the beginning of this repository.

View file

@ -11,12 +11,12 @@ It is designed to work with Clojure 1.10 or later, supports `datafy`/`nav`, and
You can add `next.jdbc` to your project with either: You can add `next.jdbc` to your project with either:
```clojure ```clojure
com.github.seancorfield/next.jdbc {:mvn/version "1.3.967"} com.github.seancorfield/next.jdbc {:mvn/version "1.3.981"}
``` ```
for `deps.edn` or: for `deps.edn` or:
```clojure ```clojure
[com.github.seancorfield/next.jdbc "1.3.967"] [com.github.seancorfield/next.jdbc "1.3.981"]
``` ```
for `project.clj` or `build.boot`. for `project.clj` or `build.boot`.
@ -38,7 +38,7 @@ For the examples in this documentation, we will use a local H2 database on disk,
```clojure ```clojure
;; deps.edn ;; deps.edn
{:deps {org.clojure/clojure {:mvn/version "1.12.0"} {:deps {org.clojure/clojure {:mvn/version "1.12.0"}
com.github.seancorfield/next.jdbc {:mvn/version "1.3.967"} com.github.seancorfield/next.jdbc {:mvn/version "1.3.981"}
com.h2database/h2 {:mvn/version "2.3.232"}}} com.h2database/h2 {:mvn/version "2.3.232"}}}
``` ```

View file

@ -586,11 +586,10 @@ its documentation for details:
* [SQL Queries](https://docs.xtdb.com/reference/main/sql/queries.html) * [SQL Queries](https://docs.xtdb.com/reference/main/sql/queries.html)
* [SQL Transactions/DML](https://docs.xtdb.com/reference/main/sql/txs.html) * [SQL Transactions/DML](https://docs.xtdb.com/reference/main/sql/txs.html)
`next.jdbc` officially supports XTDB as of 1.3.next but there are some caveats: `next.jdbc` officially supports XTDB as of 1.3.981 but there are some caveats:
* You can use `:dbtype "xtdb"` to identify XTDB as the database type. * You can use `:dbtype "xtdb"` to identify XTDB as the database type.
* You must specify `:dbname "xtdb"` in the db-spec hash map or JDBC URL. * You must specify `:dbname "xtdb"` in the db-spec hash map or JDBC URL.
* XTDB does not support `.getTableName()` so you always get unqualified column names in result sets. * XTDB does not support `.getTableName()` so you always get unqualified column names in result sets.
* The `:max-rows` / `:maxRows` options are not (yet) supported by XTDB (use `LIMIT` in your SQL instead).
* The primary key on all tables is `_id` and it must be specified in all `INSERT` operations (no auto-generated keys). * The primary key on all tables is `_id` and it must be specified in all `INSERT` operations (no auto-generated keys).
* That means that `next.jdbc.sql/get-by-id` requires the 5-argument call, so that you can specify the `pk-name` as `:_id` and provide an options map. * That means that `next.jdbc.sql/get-by-id` requires the 5-argument call, so that you can specify the `pk-name` as `:_id` and provide an options map.
* If you want to use `next.jdbc`'s built-in `datafy` / `nav` functionality, you need to explicitly specify `:schema-opts {:pk "_id"}` to override the default assumption of `id` as the primary key. * If you want to use `next.jdbc`'s built-in `datafy` / `nav` functionality, you need to explicitly specify `:schema-opts {:pk "_id"}` to override the default assumption of `id` as the primary key.

View file

@ -15,7 +15,7 @@ services:
ports: ports:
- "1433:1433" - "1433:1433"
xtdb: xtdb:
image: ghcr.io/xtdb/xtdb image: ghcr.io/xtdb/xtdb:nightly
pull_policy: always pull_policy: always
ports: ports:
- "5432:5432" - "5432:5432"

View file

@ -163,7 +163,6 @@
(is (every? int? (map first (rest rs)))) (is (every? int? (map first (rest rs))))
(let [n (max (.indexOf ^java.util.List (first rs) :name) 1)] (let [n (max (.indexOf ^java.util.List (first rs) :name) 1)]
(is (every? string? (map #(nth % n) (rest rs))))))) (is (every? string? (map #(nth % n) (rest rs)))))))
(when-not (xtdb?) ; XTDB does not support this yet
(testing "execute! with :max-rows / :maxRows" (testing "execute! with :max-rows / :maxRows"
(let [rs (jdbc/execute! (let [rs (jdbc/execute!
ds-opts ds-opts
@ -182,7 +181,7 @@
(is (every? meta rs)) (is (every? meta rs))
(is (= 2 (count rs))) (is (= 2 (count rs)))
(is (= 1 ((column :FRUIT/ID) (first rs)))) (is (= 1 ((column :FRUIT/ID) (first rs))))
(is (= 2 ((column :FRUIT/ID) (last rs)))))))) (is (= 2 ((column :FRUIT/ID) (last rs)))))))
(testing "prepare" (testing "prepare"
;; default options do not flow over get-connection ;; default options do not flow over get-connection
(let [rs (with-open [con (jdbc/get-connection (ds)) (let [rs (with-open [con (jdbc/get-connection (ds))