Just an idle musing - I think DSLs (in general) are really powerful when 
you can declare them in your application.  However, whenever I have to 
programatically construct them (constructing them based on JSON from the UI 
for example) I find it is often easier to just use build up the SQL 
directly.  

Given Clojure's excellent 'structural manipulation' and 'pretty much 
everything is structure' capabilities maybe that is no longer the case. 
 The transformation from JSON to sqlkorma for example will be almost 
entirely be structural changes. In other languages you don't have that, you 
tend to need to build up state through method calls. 

End of musing.

On Tuesday, 9 July 2013 01:55:54 UTC+1, James Ferguson wrote:
>
>
>
> On Monday, July 8, 2013 5:28:07 PM UTC-4, Colin Yates wrote:
>>
>> Using the latest release of java.jdbc, does anybody know how I can 
>> construct a where clause when I want to check if the value is one of many 
>> values?
>>
>> For example, if I have a filter {:age [1 2 3 4]} then (sql/where filter) 
>> causes an error: "Wrong data type: java.lang.NumberFormatException: For 
>> input string: "[1 2 3 4]".  
>>
>> Any idea how to do this in clojure.java.jdbc?  
>>
>
> I've been using http://sqlkorma.com/ for CRUD. A query with your filter 
> would be
>
> (select tablename
>   (where {:age [in [1 2 3 4]]}))
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to