Is clojureql powerful and flexible enough to support custom dynamic SQL with tons of joins, database function invocations in the SELECT clause, sub-selects, unions, etc.?
Most of our applications are written in Java and we have been doing parameter substitution sometimes using string variables in the query and other times using prepared statements (using open source or home grown database access frameworks). Parameter bindings are retrieved from hash maps or object properties and SQL is generated on the fly. I don't see how else to do this. Also our SQLs are complex and often need tuning and optimization. Can clojureql help with this? -----Original Message----- From: clojure@googlegroups.com [mailto:clojure@googlegroups.com] On Behalf Of Alan Sent: Thursday, March 17, 2011 1:12 PM To: Clojure Subject: Re: strint and macro expansion On Mar 17, 8:34 am, "Bhinderwala, Shoeb" <sabhinderw...@wellington.com> wrote: ...use the strint *MACRO*... ...works when I specify my string [as a literal]... ...but doesn't work when I pass the string through a variable. Macros are not functions. << is receiving as arguments a list with the two elements 'str and 'q. It must operate on them at compile time, before q has been given a run-time value: it cannot know what the value of q is. >From my uninformed position, strint looks like it should have been written as a function, not a macro, but probably there are reasons it was not. As an aside: it is sheer folly to interpolate strings for use in SQL queries. Do not do it; it will end in tears. PHP makes it easy, which is why there are so many SQL injection issues in PHP-powered sites. Be happy that this did not work: it has provided the mailing list with an opportunity to steer you towards clojureql. -- 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 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