prep for 1.3.981; test against xtdb nightly
Signed-off-by: Sean Corfield <sean@corfield.org>
This commit is contained in:
parent
801e6c923b
commit
b981357d47
6 changed files with 28 additions and 30 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
||||
[](https://clojars.org/com.github.seancorfield/next.jdbc)
|
||||
[](https://cljdoc.org/d/com.github.seancorfield/next.jdbc/CURRENT)
|
||||
[](https://clojars.org/com.github.seancorfield/next.jdbc)
|
||||
[](https://cljdoc.org/d/com.github.seancorfield/next.jdbc/CURRENT)
|
||||
[](https://clojurians.slack.com/app_redirect?channel=sql)
|
||||
[](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.
|
||||
|
||||
|
|
|
|||
|
|
@ -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"}}}
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in a new issue