From c8cf8c7d2f53c06efa83ba5523ff00a620a26646 Mon Sep 17 00:00:00 2001 From: Sean Corfield Date: Fri, 15 Sep 2023 15:58:18 -0700 Subject: [PATCH] fix #257 --- CHANGELOG.md | 1 + src/next/jdbc/specs.clj | 31 +++++++++++++++++++++++++------ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41e6c37..019029a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ Only accretive/fixative changes will be made from now on. * 1.3.next in progress + * Fix [#257](https://github.com/seancorfield/next-jdbc/issues/257) by making the `fdef` spec for `with-transaction` more permissive. Also add specs for `on-connection` and the `+options` variants of both macros. * Address [#256](https://github.com/seancorfield/next-jdbc/issues/256) by adding `with-transaction+options` and `on-connection+options`. Documentation TBD. * Update `tools.build` to 0.9.5 (and remove `:java-opts` from `build/test`) diff --git a/src/next/jdbc/specs.clj b/src/next/jdbc/specs.clj index 5ed6a19..1c269c9 100644 --- a/src/next/jdbc/specs.clj +++ b/src/next/jdbc/specs.clj @@ -1,4 +1,4 @@ -;; copyright (c) 2019-2021 Sean Corfield, all rights reserved +;; copyright (c) 2019-2023 Sean Corfield, all rights reserved (ns next.jdbc.specs "Specs for the core API of next.jdbc. @@ -151,11 +151,30 @@ :opts ::opts-map)) (s/fdef jdbc/with-transaction - :args (s/cat :binding (s/and vector? - (s/cat :sym simple-symbol? - :transactable ::transactable - :opts (s/? ::opts-map))) - :body (s/* any?))) + :args (s/cat :binding (s/and vector? + (s/cat :sym simple-symbol? + :transactable ::transactable + :opts (s/? any?))) + :body (s/* any?))) + +(s/fdef jdbc/with-transaction+options + :args (s/cat :binding (s/and vector? + (s/cat :sym simple-symbol? + :transactable ::transactable + :opts (s/? any?))) + :body (s/* any?))) + +(s/fdef jdbc/on-connection + :args (s/cat :binding (s/and vector? + (s/cat :sym simple-symbol? + :connectable ::connectable)) + :body (s/* any?))) + +(s/fdef jdbc/on-connection+options + :args (s/cat :binding (s/and vector? + (s/cat :sym simple-symbol? + :connectable ::connectable)) + :body (s/* any?))) (s/fdef connection/->pool :args (s/cat :clazz #(instance? Class %)