CPAN::Forum
DBD-SQLite - Calling sqlite3RunParser directly to just *parse* SQL code
| Posted on Thu Aug 4 23:41:14 2005 by scunacc |
| Calling sqlite3RunParser directly to just *parse* SQL code |
|
Dear all,
I have a "meta" application that's a bit like the sqlite shell (except
it's not interactive) in which people write statements that are parsed
by Perl that contain SQL statements that are passed *unparsed* by Perl
to SQLite via DBD::SQLite.
Some of the queries are long.
To save time, users would like to be able to parse the SQL in the meta
app before actually running the meta app. Clearly since this is going to
run through SQLite, it'd be nice if the actual SQLite parser could parse
it 1st. (I looked at SQL::Statement::Structure and wasn't happy with it
- broke on things that sqlite accepts - and I didn't want to have to
rewrite the grammar to append sqlite-OK items)
So, having looked at the source code for the DBD driver and sqlite3, it
would seem that the appropriate function to call would be
sqlite3RunParser.
Is there any extant code that would show this being used more or less
"by itself" in an application, (i.e. w/o the heavy weight of the rest of
the sqlite code scaffolding)? C code would be fine (and I'd call it as
an external app 1st of all and maybe integrate later) - though I'd like
to really have this as a Perl module if possible.
I wanted to avoid the trial and error of figuring out which headers and
what linkage and which data structures I would need to establish to
minimally call this function I guess.
I also couldn't see a way of (easily) extending the Perl i/face either via DBI
or DBD.
If I've missed anything obvious here, apart from the fact that I may just
have to roll up sleeves and get to it :-) then by all means direct me
to the info.
Any help appreciated.
Thanks!
Kind regards
Derek Jones.
|
| Direct Responses: 842 | Write a response |
(14)
]