From 58bdb53f3478fcb2ef400fc2880623b8fe76f0ed Mon Sep 17 00:00:00 2001 From: Sean Corfield Date: Fri, 27 Sep 2019 22:22:23 -0700 Subject: [PATCH] Fixes #67 by updating specs for :jdbcUrl --- CHANGELOG.md | 2 +- src/next/jdbc/specs.clj | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35aeda9..b6c1530 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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.8 release: -* None. +* Fix #67 by adding `:jdbcUrl` version spec. ## Stable Builds diff --git a/src/next/jdbc/specs.clj b/src/next/jdbc/specs.clj index ef83770..28110bf 100644 --- a/src/next/jdbc/specs.clj +++ b/src/next/jdbc/specs.clj @@ -42,14 +42,19 @@ ::host ::port ::dbname-separator ::host-prefix])) +(s/def ::jdbcUrl string?) +(s/def ::jdbc-url-map (s/keys :req-un [::jdbcUrl])) (s/def ::connection #(instance? Connection %)) (s/def ::datasource #(instance? DataSource %)) (s/def ::prepared-statement #(instance? PreparedStatement %)) -(s/def ::db-spec (s/or :db-spec ::db-spec-map - :string string? - :ds ::datasource)) +(s/def ::db-spec (s/or :db-spec ::db-spec-map + :jdbc-url ::jdbc-url-map + :string string? + :ds ::datasource)) +(s/def ::db-spec-or-jdbc (s/or :db-spec ::db-spec-map + :jdbc-url ::jdbc-url-map)) (s/def ::connectable any?) (s/def ::key-map (s/map-of keyword? any?)) @@ -117,7 +122,7 @@ (s/fdef connection/->pool :args (s/cat :clazz #(instance? Class %) - :db-spec ::db-spec-map)) + :db-spec ::db-spec-or-jdbc)) (s/fdef prepare/execute-batch! :args (s/cat :ps ::prepared-statement