I'm looking for a C/C++ SQL parsing library which is able to provide me with the names of the tables the query depends on.
What I expect:
SELECT * FROM TABLEA NATURAL JOIN TABLEB
Result: TABLEA, TABLEB
Certainly provided example is extremly simple. I've already written my own parser (based on Boost.Spirit) which handles a subset of SQL grammar, but what I need is a parser which is able to handle complicated (recursive etc.) queries.
Do you know anything useful for this purpose?
What I found is http://www.sqlparser.com - it's commercial but does exactly what I need. I also digged into the PostgreSQL sources, no effect.