@Mark: Thanks! :)

@Jeff: Thanks a lot. Link is fixed now.

@Sam: Thanks!

@James: Wow - I should put that in my resume, thanks a lot !

@Mark E:
Half right.

ClojureQL has a major focus on queries as they are the largest
part of our interaction with databases. However it piggy-backs
on contrib.sql and the functions provided there for creating tables,
dropping them etc are well suited for the job, so simply use those.

ClojureQL also has conj!, disj! and update-in! for manipulating
tables.

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

There are probably still a few minor quirks (what you see above is
fresh from the REPL),
but if nobody sues me in the next month and if I manage to
automatically paramterize all
queries 1.0.0 FINAL should be just up ahead.

Thanks to all who have tried this out already,
Lau

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