Re: Re: Writing a parser
| From: | Brent Cook | Date: | Tue, 09 Jul 2002 15:53:40 +0000 |
| Subject: | Re: Re: Writing a parser | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-7592@lists.php.net to get a copy of this message | ||
> On 07/08/2002 01:20 PM, Brent Cook wrote:
> > Dear Folks,
> >
> > I'm writing a SQL parser for DB_DBA.
>
> Maybe you haven't thought of that but most SQL DBMS as just that, a SQL
> parser with a query engine that executes queries on database files like
> that.
>
> So my question what would be the advantage of using a slow SQL wrapper
> that you intend to do in PHP, over using a real SQL DBMS like MySQL,
> PostgreSQL, Oracle, etc..?
Yes, this would be silly to use as a wrapper around a call to another SQL
DBMS, but I'm writing this for DBA, which has no SQL parser at all. And
I'm writing DBA because I have no access to a "real" DBMS, and feel that
this would benefit other people who need a database but only have access
to PHP.
Compared to the time complexity of, say, a join operation on large tables
without secondary indexes, parsing SQL would be a drop in the bucket. Once
a SQL query is parsed, the resulting execution plan can be cached too.
Even real SQL DBMS's do this.
A SQL parser could even be used to generate XML schema files directly from
SQL CREATE statements for those wanting to try MDB/Metabase.
- Brent