Hi Sean, Yes the two statements are equivalent. ClojureQL compiles everything to prepared statements, with every argument automatically paramterized. You shouldn't have to call the compiler function directly, ever. For quick inspection, simply type the statement in the repl and it will emit the SQL statement, because I've overridden the print-method
user> (table :users) SELECT * FROM users user> (class *1) clojureql.core/RTable Its not a string, as you can see. For junior developers, the generated SQL statements will sometimes outperform what they would have written by hand. For SQL masters, it should hopefully generate what they would have written by hand. Lau On Jan 6, 4:23 am, Sean Corfield <seancorfi...@gmail.com> wrote: > On Wed, Jan 5, 2011 at 6:14 AM, LauJensen <lau.jen...@bestinclass.dk> wrote: > > Just a quick heads up that ClojureQL 1.0.0 is now released. All > > interfaces should be final and there are no known bugs. > > Looks really interesting. We're about to start moving some of our web > app back end over to Clojure and this might be a good fit but I'd be a > little concerned about performance and the docs don't give me enough > data to figure that aspect out... > > Normally I'd expect systems like this to compile to a SQL prepared > statement so arguments can be provided without needing to recompile > the AST to SQL and recompile the SQL but I don't see anything like > that in the docs (I see a mention of a (compile) function on the > examples page but it isn't mentioned in the documentation). > > For example, with c.c.sql, I'd write something like: > > (sql/with-query-results rows > ["SELECT dateofbirth, gender, zipcode > FROM user > WHERE id = ?" user-id] > ( ... process rows ... )) > > With ClojureQL, the obvious query would be (I think): > > (-> (table :user) > (select (where (= :id user-id))) > (project [:dateofbirth :gender :zipcode])) > > But is that really the same? > -- > Sean A Corfield -- (904) 302-SEAN > Railo Technologies, Inc. --http://getrailo.com/ > An Architect's View --http://corfield.org/ > > "If you're not annoying somebody, you're not really alive." > -- Margaret Atwood -- 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