Closed bendlas closed 13 years ago
on a related note; do you think it would be worthwhile to have a compiler protocol here? Like (project tbl sql-expr-vec) would take instances of
(protocol RelationField
"e.g. http://www.postgresql.org/docs/8.4/static/sql-expressions.html"
(projected-name [this] "a keyword (?)")
(selectable-field-str [this] "sequence of compiled SQL string bits"))
struck me while porting
SELECT node_id,
(CASE WHEN type='container' THEN ...
WHEN type='customer' THEN ... END) FROM ...
Thanks a lot for bring this up Bendlas. I wasn't quite sure what to make of your fix since every line in a complicate tree was changed, does this look okay?
FIX: https://github.com/LauJensen/clojureql/commit/2285a7bb9c78b211082064c58394e141c8619512
Yeah, clojure-mode in my emacs does some funky things to indentation. Essentially I replaced the (if (aggregate? ..)..) with a (cond (string? ..) (aggregate?..)..)
Your fix should do the trick too, however, you wouldn't need the double (ns-keyword ..), right?
Another question would be if strings shouldn't just be included verbatim, wherever they are allowed.
(project (table :t) [["db-func(x, '\"')" :as :x]])
produces an error