(writing documentation is taking me longer than I'd hoped so I'm not going to cut an alpha release to http://clojars.org just yet -- but folks are still welcome to try it out via {:git/url "<https://github.com/seancorfield/honeysql>" :sha "4cbeb170ddf4ba0d7238c43b092ffb0a33062474"}
🙂 )
Special syntax docs https://github.com/seancorfield/honeysql/blob/v2/doc/special-syntax.md
If anyone does take v2 for a spin, please provide feedback -- good or bad.
Hi Sean. I plan to do a bit of playing around in the next few days with it. Slightly busy at work atm.
Hopefully I'll have positive feedback 🙂
@seancorfield Where did you land regarding spec and v2? Personally, I'd love to have a honeysql spec. I do a lot of programmatic SQL generation and transformation. I believe that having a spec will help create a honeysql AST that will make transformations easier.
@markaddleman Still on the roadmap but it's much harder than I initially thought -- since it's basically the Spec equivalent of SQL's entire syntax 🙂
ha. Yeah, that was the conclusion I came to. I was hoping you had some magic up your sleeve
Writing a Spec that just says "this data structure is acceptable to HoneySQL" is fairly tractable but that's very lax -- HoneySQL can format all sorts of otherwise rather dubious "SQL" 🙂 No guarantee the SQL itself is valid, however...
Since I want v2 to accept as much of the existing data structure DSLs out there which are used by v1, there are some inconsistencies I don't want to fix. At the same time, I've made v2 a bit more lenient in some cases where there's no ambiguity.
There's no good way to consistently make the "mistake" genuinely illegal without also prohibiting strange-but-legal stuff...
I certainly could make v2 stricter (and disallow '{select id from table where (= x 42)}
) but it would also make it more complex and probably less easy to use 😐
(and v2 deliberately accepts symbols and lists where v1 only accepted keywords and vectors -- because folks want the quoted datalog-style query format)
Understood. I encountered similar issues. I author queries by hand using using honeysql's syntax but the very first thing my transformation system does is "normalize" it (eg, all column projections have aliases, all tables have aliases, where clause expressions are converted to SqlCall records, etc).
I despair of writing a spec for the unnormalized structure but the normalized data wouldn't be too bad