I'm trying to figure out how to send a jodatime date into Postgres, for example
to generate this SQL:
SELECT animals.* FROM animals WHERE removed_from_service = '2001-11-11'
Along the way, I've discovered that the SQL queries ClojureQL prints out can't
be the ones it actually sends. Consider, for example, this:
user> (ql/select (ql/table :animals)
(ql/where (in :official_name ["1" "2 2"])))
SELECT animals.* FROM animals WHERE official_name IN (1,2 2)
If you run the query, it seems to work. But that SELECT won't work if you type
it at Postgres. The correct syntax should be:
SELECT animals.* FROM animals WHERE official_name IN ('1','2 2')
Is the REPL command I typed not the right way to see what SQL is sent to the
database?
How *does* one provide dates to ClojureQL for transmission to Postgres? I want
to do something like this:
(ql/conj! (ql/table :animals) {:official_name "fred" :added_to_service
<<<something that counts as a SQL Date>>>})
-----
Brian Marick, Artisanal Labrador
Contract programming in Ruby and Clojure
Occasional consulting on Agile
www.exampler.com, www.twitter.com/marick
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en