korma / Korma

Tasty SQL for Clojure.
http://sqlkorma.com
1.48k stars 222 forks source link

Support for hstore? #279

Closed abhishiv closed 9 years ago

abhishiv commented 9 years ago

I wanna write a query against hstore column, but not sure how to describe it using the korma dsl

SELECT * FROM ways WHERE tags @> '"place"=>"city"'::hstore

I can use raw-sql, but i'm just curious how would korma handle something like this?

immoh commented 9 years ago

Korma tries to support most commonly used database features, unfortunately queries against hstore columns is out of scope.

I would try to make the scope of raw as small as possible, e.g.:

(select :ways (where (raw "tags @> '\"place\"=>\"city\"'::hstore")))

and create some helper functions for generating the hstore string from Clojure data structure.