diff --git a/CHANGELOG.md b/CHANGELOG.md index 7854a98..418db4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ 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**. * 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. diff --git a/README.md b/README.md index ba3fd5e..4c9a23c 100644 --- a/README.md +++ b/README.md @@ -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: -[![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///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) +[![Clojars](https://img.shields.io/badge/clojars-com.github.seancorfield/next.jdbc_1.3.981-blue.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAA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JlJWXqEAVNM05ovbXfkPAHBmAUQPAGaAsXMBLiwA8z3h0gRcsWsObuAWLJu8Awb3ZoB5T8EvS/CgBo9Y5Z8TPwXBJwlUI9Ia/yRrEZ8lID71Olrf0MiamkkL4kurDEjba+C/e2sninR0wrsH8eMTvrqIWbodjh7jyjdtCY3Aniz4jwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNS0wNy0wN1QyMjo1ODo0NiswMjowMCgWtSoAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTUtMDctMDdUMjI6NTg6NDYrMDI6MDBZSw2WAAAAAElFTkSuQmCC)](https://clojars.org/com.github.seancorfield/next.jdbc) +[![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) [![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) * 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. diff --git a/doc/getting-started.md b/doc/getting-started.md index d5f8861..d53fc68 100644 --- a/doc/getting-started.md +++ b/doc/getting-started.md @@ -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: ```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: ```clojure -[com.github.seancorfield/next.jdbc "1.3.967"] +[com.github.seancorfield/next.jdbc "1.3.981"] ``` 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 ;; deps.edn {: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"}}} ``` diff --git a/doc/tips-and-tricks.md b/doc/tips-and-tricks.md index 882d15e..96074e9 100644 --- a/doc/tips-and-tricks.md +++ b/doc/tips-and-tricks.md @@ -586,11 +586,10 @@ its documentation for details: * [SQL Queries](https://docs.xtdb.com/reference/main/sql/queries.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 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. -* 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). * 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. diff --git a/docker-compose.yml b/docker-compose.yml index dc6492a..a6095e2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,7 +15,7 @@ services: ports: - "1433:1433" xtdb: - image: ghcr.io/xtdb/xtdb + image: ghcr.io/xtdb/xtdb:nightly pull_policy: always ports: - "5432:5432" diff --git a/test/next/jdbc_test.clj b/test/next/jdbc_test.clj index 6a6cb64..87ab505 100644 --- a/test/next/jdbc_test.clj +++ b/test/next/jdbc_test.clj @@ -163,26 +163,25 @@ (is (every? int? (map first (rest rs)))) (let [n (max (.indexOf ^java.util.List (first rs) :name) 1)] (is (every? string? (map #(nth % n) (rest rs))))))) - (when-not (xtdb?) ; XTDB does not support this yet - (testing "execute! with :max-rows / :maxRows" - (let [rs (jdbc/execute! - ds-opts - [(str "select * from fruit order by " (index))] - {:max-rows 2})] - (is (every? map? rs)) - (is (every? meta rs)) - (is (= 2 (count rs))) - (is (= 1 ((column :FRUIT/ID) (first rs)))) - (is (= 2 ((column :FRUIT/ID) (last rs))))) - (let [rs (jdbc/execute! - ds-opts - [(str "select * from fruit order by " (index))] - {:statement {:maxRows 2}})] - (is (every? map? rs)) - (is (every? meta rs)) - (is (= 2 (count rs))) - (is (= 1 ((column :FRUIT/ID) (first rs)))) - (is (= 2 ((column :FRUIT/ID) (last rs)))))))) + (testing "execute! with :max-rows / :maxRows" + (let [rs (jdbc/execute! + ds-opts + [(str "select * from fruit order by " (index))] + {:max-rows 2})] + (is (every? map? rs)) + (is (every? meta rs)) + (is (= 2 (count rs))) + (is (= 1 ((column :FRUIT/ID) (first rs)))) + (is (= 2 ((column :FRUIT/ID) (last rs))))) + (let [rs (jdbc/execute! + ds-opts + [(str "select * from fruit order by " (index))] + {:statement {:maxRows 2}})] + (is (every? map? rs)) + (is (every? meta rs)) + (is (= 2 (count rs))) + (is (= 1 ((column :FRUIT/ID) (first rs)))) + (is (= 2 ((column :FRUIT/ID) (last rs))))))) (testing "prepare" ;; default options do not flow over get-connection (let [rs (with-open [con (jdbc/get-connection (ds))