From 9b6cf6d4d8000b386b94ea5c975588f5e98f6d8a Mon Sep 17 00:00:00 2001 From: Paula Gearon Date: Thu, 7 Jan 2021 21:24:02 -0500 Subject: [PATCH] URI bugfix --- CHANGELOG.md | 7 ++++++- README.md | 6 +++--- project.clj | 2 +- src/asami/core.cljc | 5 +++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf8cd70..e5c4cb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +## [1.2.9] - 2021-01-07 +### Fixed +- Auto generated connection URIs were malformed, and have been fixed. + ## [1.2.8] - 2020-12-14 ### Changed - Updated to Zuko 0.3.3 for performance improvement in loading entities. @@ -89,7 +93,8 @@ ### Added - Introduced Update Annotations -[Unreleased]: https://github.com/threatgrid/asami/compare/1.2.8...HEAD +[Unreleased]: https://github.com/threatgrid/asami/compare/1.2.9...HEAD +[1.2.9]: https://github.com/threatgrid/asami/compare/1.2.8...1.2.9 [1.2.8]: https://github.com/threatgrid/asami/compare/1.2.7...1.2.8 [1.2.7]: https://github.com/threatgrid/asami/compare/1.2.6...1.2.7 [1.2.6]: https://github.com/threatgrid/asami/compare/1.2.5...1.2.6 diff --git a/README.md b/README.md index 527cbe9..cdda6f0 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Asami can be made available to clojure by adding the following to a `deps.edn` f ```clojure { :deps { - org.clojars.quoll/asami {:mvn/version "1.2.8"} + org.clojars.quoll/asami {:mvn/version "1.2.9"} } } ``` @@ -37,7 +37,7 @@ This makes Asami available to a repl that is launched with the `clj` or `clojure Alternatively, Asami can be added for the Leiningen build tool by adding this to the `:dependencies` section of the `project.clj` file: ```clojure -[org.clojars.quoll/asami "1.2.8"] +[org.clojars.quoll/asami "1.2.9"] ``` ### Running @@ -270,7 +270,7 @@ If functions are provided to Loom, then they can be used to provide labels for c ## License -Copyright © 2016-2020 Cisco +Copyright © 2016-2021 Cisco Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version. diff --git a/project.clj b/project.clj index 47fe972..d5d5081 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject org.clojars.quoll/asami "1.2.8" +(defproject org.clojars.quoll/asami "1.2.9" :description "An in memory graph store for Clojure and ClojureScript" :url "http://github.com/threatgrid/asami" :license {:name "Eclipse Public License" diff --git a/src/asami/core.cljc b/src/asami/core.cljc index eacaa06..edcc080 100644 --- a/src/asami/core.cljc +++ b/src/asami/core.cljc @@ -23,7 +23,8 @@ uri (if-let [[_ db-type db-name] (re-find #"asami:([^:]+)://(.+)" uri)] {:type db-type - :name db-name}))) + :name db-name} + (throw (ex-info (str "Invalid URI: " uri) {:uri uri}))))) (defn- connection-for "Creates a connection for a URI" @@ -84,7 +85,7 @@ "Creates a Database/Connection around an existing Graph. graph: The graph or graph wrapper to build a database around. uri: The uri of the database." - ([graph :- Graphable] (as-connection graph (name (gensym "asami:mem/internal")))) + ([graph :- Graphable] (as-connection graph (str (gensym "asami:mem://internal")))) ([graph :- Graphable uri :- s/Str] (let [{:keys [name]} (parse-uri uri)