Fork me on GitHub
#honeysql
<
2022-08-09
>
sheluchin12:08:03

Is there any way to convert raw SQL to HoneySQL expressions?

👀 1
seancorfield18:08:59

Someone would have to write a full SQL parser. That's a lot of work (and very hard).

sheluchin18:08:42

Fair enough. Thought I'd ask just in case. Some changes are just so easy to make in DB GUI - it would make to a nice workflow to be able to copy stuff from the transaction log and into your clj project as HoneySQL. Thanks @U04V70XH6.

seancorfield18:08:28

It's been asked several times over the years -- but no one is willing to put in the time and effort to write such a thing 🙂

sheluchin19:08:28

And that's understandable, but it would sure be cool 🙂

krydos17:08:11

There is https://github.com/camsaul/sqlhoney by @U42REFCKA It’s unable to parse complex queries but it’s a good base for that special someone who’s willing to spend time on this. It also has the best name for such kind of tool indeed

sheluchin17:08:11

@U03G0UUUD8E thanks for the link. That name is a home run, for sure.

Cam Saul17:08:44

It's definitely not ready for prime time, more of a proof of concept than anything else. I do plan on fleshing it out at some point in the next year or so. SQL parsing is something we want to add to Metabase so if anything I'll need to do it as part of my day job

Cam Saul17:08:10

In the meantime tho you should be able to build on it to do what you need

🙌 1