@Wilson,

Normally I release the jar to clojars when I implement some major
change
of interest to the public, but the compiler above didn't not get
released
due to forgetfulness on my part!

I was reworking the predicate compiler into a very fancy record which
does automated parameterization of all predicates and wanted to
include this as well. It turned out quite nice, as the (toString)
interface
made most of the old code work:

cql.predicates> (where (or (= :x 5) (< 10 :y 5)))
#:cql.predicates.APredicate{:stmt ["(( ? = ? ) OR ( ? < ?
< ? ))"], :env ["x" 5 10 "y" 5]}
cql.predicates> (str *1)
"(( ? = ? ) OR ( ? < ? < ? ))"
cql.predicates> (:env *2)
["x" 5 10 "y" 5]

I hope to release this very shortly as its the final building block
needed
for 1.0.0 FINAL - Injection protection.

Lau

On Nov 23, 4:57 pm, Wilson MacGyver <wmacgy...@gmail.com> wrote:
> On Tue, Nov 23, 2010 at 5:34 AM, LauJensen <lau.jen...@bestinclass.dk> wrote:
> > And finally, I've just refurbished the compiler so that its not a
> > 25 line beast of a recursive machine that automatically spawns
> > subselects for aggregates, limit/offset and predicates:
>
> > cql.core> (to-sql (-> (table {} :users)
> >                            (join (table {} :salary)
> >                                  (where (= :users.id :salary.id)))
> >                            (outer-join (take (table :wages)
> > 5) :left :id)
> >                            (join (select (table :test) (where (> :id
> > 5))) (where (= :test.id :users.id)))
> >                            (project [:users.id :salary.wage])
> >                            (select (where (= :test.id :wages.id)))))
>
> > SELECT users.id,salary.wage,wages_subselect.*,test_subselect.* FROM
> > users
> > JOIN salary ON (users.id = salary.id) LEFT OUTER JOIN
> > (SELECT wages.* FROM wages LIMIT 5) AS wages_subselect USING(id)
> > JOIN (SELECT test.* FROM test WHERE (id > 5)) AS test_subselect ON
> > (test_subselect.id = users.id) WHERE (test_subselect.id =
> > wages_subselect.id)"
>
> Great work. Has the updated version been pushed to clojars yet? Or do I
> need to git pull and build manually?
>
> --
> Omnem crede diem tibi diluxisse supremum.

-- 
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