Are the SQL parsing capabilities of DataGrip exposed anywhere?

Answered

I've been looking for a good way to parse SQL statements for "easy" identification and manipulation of the various clauses of a statement created for a PostgreSQL database in my VB.NET WinForms application. The project I'm working on is an internal system I'm building/reworking for my company's employees - not for public/commercial release.

I've looked at several tools and libraries that are available, including paid commercial products like the General SQL Parser, "free" open-source libraries like Npgsql, and even some "roll-your-own" solutions like Sergey Gorbenko's SQL Parser demo on Code Project. I've tried working with ANTLR using their plsql grammar but, for whatever reason, I keep running into walls and can't seem to get what I'm looking for out of it. Even if I could get it working, it still doesn't seem an "ideal" solution for what I'm trying to do. I know I can "manually" rebuild my SQL statements, or whatever, but I was hoping to find something more flexible and reusable as a long-term solution.

While I've been on the hunt for some time, I just recently posted a question on StackOverflow (see my .NET Library to Parse/Modify/Reconstruct SQL Statement post for a more thoroughly detailed explanation of what I'm trying to accomplish), but I've yet to come up with anything "concrete". I've been directed back to trying to use ANTLR, but I still haven't been able to get it working the way I want. I'm certain I'm just missing or overlooking something, but I can't keep wasting my time trying to chase it down.

I had hoped that the Npgsql library I use in my application would have some "built-in" functionality that would help me achieve my goals but, while I would assume there's at least some of the framework necessary to get there already in place because of the nature of the project itself, that's apparently considered "unnecessary code to maintain".

This was all "floating around" when my annual renewal of DataGrip came due and I saw this:

I realize this isn't intended as the solution I'm looking for but I figured I'd go ahead and ask because "why not?". So, here's the actual question for those of you at JetBrains: Is there a DataGrip library I could add to my .NET project that would enable me to parse/modify/reconstruct a SQL statement? Barring that, is there perhaps some sort of DataGrip plug-in for Visual Studio that could provide this or similar functionality?

0
1 comment
Avatar
Yuriy Vinogradov

There is no such library unfortunately.

0

Please sign in to leave a comment.