funcool / clojure.jdbc

JDBC library for Clojure
http://funcool.github.io/clojure.jdbc/latest/
Apache License 2.0
105 stars 26 forks source link

assert failed: (vector? sql-with-params): make-query #4

Closed lnostdal closed 10 years ago

lnostdal commented 10 years ago

I'm getting this:

(with-connection {:datasource -pooled-db-spec-} db
  (query db ["SELECT 3 * 2;"]))
=>
AssertionError Assert failed: (vector? sql-with-params)  jdbc/make-query (jdbc.clj:416)
lnostdal commented 10 years ago

...seems this is because conn isn't passed on to the make-query call in query.

lnostdal commented 10 years ago

Also, this looks strange: https://github.com/niwibe/clj.jdbc/blob/master/src/jdbc.clj#L448 .. how can it ever be a string when the :pre check requires a vector?

niwinz commented 10 years ago

You are right! query function is introduced in earlier commits and it was untested. Now, I have added test for it and fix this issue.

Also, I have fixed a pre conditions for accept strings.

Thanks for report it! ;)