diff options
author | Carlo Zancanaro <carlo@clearboxsystems.com.au> | 2013-07-12 10:46:10 +1000 |
---|---|---|
committer | Carlo Zancanaro <carlo@clearboxsystems.com.au> | 2013-07-12 10:46:10 +1000 |
commit | 768006571aaa1b036974ba5dec648b531de49363 (patch) | |
tree | 1cef766469ef57be241eaf7c98c1ebe23050453f /src/clojure_sql/jdbc.clj | |
parent | 570d86b1bfa4099a6af5c71a733f622fbf49f959 (diff) |
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.
Diffstat (limited to 'src/clojure_sql/jdbc.clj')
-rw-r--r-- | src/clojure_sql/jdbc.clj | 2 |
1 files changed, 2 insertions, 0 deletions
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)) |