3 ms·
Perhaps you're looking for a way of arranging SQL as an AST represented by data structures (or objects) that can be fed to a compiler. HoneySQL[0] is one such i
by emidln 4y ago
Perhaps you're looking for a way of arranging SQL as an AST represented by data structures (or objects) that can be fed to a compiler. HoneySQL[0] is one such implementation of this idea and it makes your general transformation trivial for Clojure programs. You don't need to mess around with string concatenation because you have a predictable and extensible compiler for data structures (which are themselves easily composable/transformable/storable with Clojure) that you can trust to do the right thing. If you're using some weird database or need an esoteric syntax, extending the compiler to your clause is easy to do[1].
[0] https://github.com/seancorfield/honeysql https://github.com/seancorfield/honeysql
[1] https://github.com/seancorfield/honeysql#extensibility https://github.com/seancorfield/honeysql#extensibility
- fny 4y agoI've started to toy with this already and using a tool like sql parse to abstract existing queries. Like say you have a query that applies to one table and potentially others where the column names are slightly different. Why cant you just port that query?