summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Expand)Author
2013-05-24Fix a bug in `resolve-fields`...The recursive calls to `resolve-fields` were not being made due to programmer error. This has been fixed, so now the field resolution stuff should work properly again. This is really highlighting the need for better testing. Get on that! Carlo Zancanaro
2013-05-23Simplify the compiler, better subquery support...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. Carlo Zancanaro
2013-05-15Split out core into compiler/dsl/query....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. Carlo Zancanaro
2013-05-14Parametrise deref behaviour, add two small tests....Now a user can decide what the query's behaviour on deref should be. This means a user using jdbc can plug in with (set-query-deref-behaviour! #(... jdbc-query-code-here ...)) if they want, but if a user wants to use the code for something else then they can do so without needing to import jdbc stuff. (I'll admit I'm not sure what else they'd do with it, but that's slightly beside the point.) Still left to do is to provide a helper for the common case (performing an SQL query with jdbc). Carlo Zancanaro