Anyone aware of efforts to turn string SQL queries into honey sql? Via an AST maybe? This was my first hit when I googled for a sql parser https://github.com/JSQLParser/JSqlParser
The XTDB 2.x SQL parser & AST rewrite namespace might be a reasonable starting point for such a thing https://github.com/xtdb/xtdb/blob/2.x/core/src/main/clojure/xtdb/sql/plan.clj
Maybe something more simplistic could be built specifically for HoneySQL without needing the full semantic analysis machinery, but I wouldn't bet on it 🤔
It's been asked repeatedly over the years but SQL parsing is a massive effort -- as the XTDB folks know -- and completely out of scope for HoneySQL.
See https://github.com/seancorfield/honeysql/issues/182 for at least one thread on it -- and why an ANSI SQL parser alone is not sufficient.
Yeah, I see the issues with being dialect neutral. For me it would be a one-off thing to convert lots of pretty standard MySQL queries into HoneySQL. So I was interested in hearing if anyone has done something similar for migration rather than a general solution.
I'm not sure if anyone here is trying to use ClojureCLR but I just pushed some changes to HoneySQL to get at least basic compatibility in place... testing and feedback welcome!