Hi Sean,

Half right - It will compile everytime, but not necessary create the
AST everytime:

(let [my-table (-> (table :user)
    (select (where (= :id user-id)))
    (project [:dateofbirth :gender :zipcode]))]
  (repeatedly @my-table))

However I see there are some good thoughts on optimization in this
thread already.
Perhaps is the AST always kept the SQL representation in a field, we
could totally
avoid re-compilation for repeat queries. That would still created the
preparedStatement,
but Im not sure thats a real time-stealer. I'll have to check.

On Jan 7, 1:33 am, Sean Corfield <seancorfi...@gmail.com> wrote:
> On Thu, Jan 6, 2011 at 2:33 AM, LauJensen <lau.jen...@bestinclass.dk> wrote:
> > Yes the two statements are equivalent. ClojureQL compiles everything
> > to prepared
> > statements, with every argument automatically paramterized.
>
> Cool, that's what I'd hoped. But just to clarify...
>
> If I have code that repeatedly calls this:
>
> @(-> (table :user)
>     (select (where (= :id user-id)))
>     (project [:dateofbirth :gender :zipcode]))
>
> it is going to construct that AST and compile it to SQL every time it
> hits it, yes?
> --
> 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

Reply via email to