Fork me on GitHub
#honeysql
<
2023-05-21
>
DrLjótsson16:05:45

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

refset17:05:18

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

refset17:05:58

Maybe something more simplistic could be built specifically for HoneySQL without needing the full semantic analysis machinery, but I wouldn't bet on it :thinking_face:

seancorfield17:05:09

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.

seancorfield17:05:33

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.

👀 1
DrLjótsson17:05:26

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.

seancorfield23:05:45

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!

🎉 2
❤️ 2