summaryrefslogtreecommitdiff
path: root/src/clojure_sql/query.clj
AgeCommit message (Collapse)Author
2013-11-12Change the query executor model: now it's query local and the interface is ↵Carlo Zancanaro
managed by a protocol.
2013-06-20A few small changes/fixes to join behaviour, and code cleanupCarlo Zancanaro
Fix compilation of cross joins. Remove the sort clauses on queries when they become subqueries in joins because then the sorting means nothing (although when take/drop stuff is added the sort will be relevant, so we'll see about that). Favour the left side of a join, which is mostly only relevant for the outer join case (and technically it's not quite right for full-outer joins, maybe, but I'll get to that later).
2013-05-23Simplify the compiler, better subquery supportCarlo Zancanaro
The compiler's been simplified a bit by breaking out the `writer` stuff into its own namespace and by generally making the monadic stuff better. It's all hidden behind a nice, simple, `clojure-sql.compiler/compile` function now. Call that and you'll get back what you need. (Internally it's a writer monad which is really modelled as a state monad with the only operation able to be performed on the state being `tell`.) Subqueries are now handled by the DSL in such a way as to not blow up everything. Subqueries have no support for referencing values in the superquery, though, so their utility is quite limited at present. Thinking about how to do subqueries properly may be difficult.
2013-05-15Split out core into compiler/dsl/query.Carlo Zancanaro
The query namespace really only exists because I didn't want to put it in dsl, but I couldn't put it in core without a circular dependency. Users should only have to :require core to do things, though. It just aliases other stuff to make that work.