From 768006571aaa1b036974ba5dec648b531de49363 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Fri, 12 Jul 2013 10:46:10 +1000 Subject: Assert in jdbc interface to fail early rather than do the wrong thing When converting dotted fields to maps there's one possible case where it can do the wrong thing. This should now throw an AssertionError rather than silently doing the wrong thing. --- src/clojure_sql/jdbc.clj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/clojure_sql/jdbc.clj b/src/clojure_sql/jdbc.clj index 5b9de12..44ed55e 100644 --- a/src/clojure_sql/jdbc.clj +++ b/src/clojure_sql/jdbc.clj @@ -8,6 +8,8 @@ (let [dotted (name key) keys (string/split dotted #"\.") keywords (map keyword keys)] + (assert (nil? (get-in acc keywords nil)) + "Error converting fields to maps: conflicting paths.") (assoc-in acc keywords val))) {} obj)) -- cgit v1.2.3