Open source SQL Parser using C++

N

nik

Hi,

I need to parse incoming SQL statements (SELECT, INSERT, DELETE etc)
and generate a parse tree. Also i need to find out if there are syntax
errors etc.

Is there any open source SQL Parser which i can use? Also at some
point, i would need to support join etc also so i would need some sort
of SQL Optimizer or Query processor also.

I want to provide SQL interface to a non-sql db which has its own
access APIs. So idea is to tokenize in-coming SQL, validate it and
then using a mapper, access the non-sql db and return the results.

Any comment or input appreciated...If some one has more better design
alternative or open source product which can do the similar task, it
is also welcome.

Thanks in advance,
 
V

Victor Bazarov

nik said:
[..]
Is there any open source SQL Parser which i can use? [..]

Isn't there an SQL newsgroup where you could ask? Parsing
SQL in C++ is NOT C++-specific. It's SQL-specific. That
makes your question off-topic, sorry. Also, GIYF.

V
 
S

sss.zhou

Hi,

I need to parse incoming SQL statements (SELECT, INSERT, DELETE etc)
and generate a parse tree. Also i need to find out if there are syntax
errors etc.

Is there any open source SQL Parser which i can use? Also at some
point, i would need to support join etc also so i would need some sort
of SQL Optimizer or Query processor also.

I want to provide SQL interface to a non-sql db which has its own
access APIs. So idea is to tokenize in-coming SQL, validate it and
then using a mapper, access the non-sql db and return the results.

Any comment or input appreciated...If some one has more better design
alternative or open source product which can do the similar task, it
is also welcome.

Thanks in advance,

MySql may include the codes of parse SQL statements.
 
R

Roland Pibinger

I need to parse incoming SQL statements (SELECT, INSERT, DELETE etc)
and generate a parse tree. Also i need to find out if there are syntax
errors etc.
Is there any open source SQL Parser which i can use? Also at some
point, i would need to support join etc also so i would need some sort
of SQL Optimizer or Query processor also.
I want to provide SQL interface to a non-sql db which has its own
access APIs. So idea is to tokenize in-coming SQL, validate it and
then using a mapper, access the non-sql db and return the results.
Any comment or input appreciated...If some one has more better design
alternative or open source product which can do the similar task, it
is also welcome.

What you describe is far from trivial. SQLite, a widely-used public
domain database, contains what you want but not packaged as library:
http://www.sqlite.org/arch.html

Best wishes,
Roland Pibinger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top