diff --git a/hugsql-core/src/hugsql/core.clj b/hugsql-core/src/hugsql/core.clj index 34264c6..d1fbc1a 100644 --- a/hugsql-core/src/hugsql/core.clj +++ b/hugsql-core/src/hugsql/core.clj @@ -57,7 +57,7 @@ and throw an exception if mismatch." [sql-template param-data] (doseq [k (map :name (filter map? sql-template))] - (when-not (get-in param-data (parameters/deep-get-vec k)) + (when-not (contains? param-data (first (parameters/deep-get-vec k))) (throw (ex-info (str "Parameter Mismatch: " k " parameter data not found.") {}))))) diff --git a/hugsql-core/test/hugsql/core_test.clj b/hugsql-core/test/hugsql/core_test.clj index 260feca..a7fdadd 100644 --- a/hugsql-core/test/hugsql/core_test.clj +++ b/hugsql-core/test/hugsql/core_test.clj @@ -173,7 +173,10 @@ (one-value-param-sqlvec {:x 1}))) (is (thrown-with-msg? ExceptionInfo #"Parameter Mismatch: :id parameter data not found." - (one-value-param db {:x 1})))) + (one-value-param db {:x 1}))) + ;; does not throw on false + (is (= ["select * from test where id = ?" false] + (one-value-param-sqlvec {:id false})))) (testing "database commands/queries" (condp = db-name