Re: Re: Writing a parser

From: Date: Tue, 09 Jul 2002 19:15:53 +0000
Subject: Re: Re: Writing a parser
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-7600@lists.php.net to get a copy of this message
There are many people who don't have access to a dbms because they don't control the server on which their code resides. For these people, a pure php approach giving them an sql interface to file based databases will be a lifesaver. Add to that the intellectual exercise this is, it sounds like fun to me plus helpful to those unfortunate souls who are dangling above the pit of no s q l hell. -timmyg At 04:09 PM 7/9/2002 -0300, Manuel Lemos wrote:
Hello, On 07/09/2002 12:53 PM, Brent Cook wrote:
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
That is not what I meant, but it is what other people are suggesting that a SQL parser would be useful for.
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.
This is odd. Why don't you have access to real DBMS like MySQL or PostgreSQL among others that are free?
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.
Yes, but they do it in C, not just the parsing but also the execution and most importantly the handling of concurrency. Anyway, one of the advantages of DBA like databases is precisely not putting up with the overhead of SQL to query them. Actually read only database applications that need to be highly scalable (memory and CPU performance) like search engines (ask Stig) use DBA like interfaces because SQL overhead is unbearable and would add to the hardware budget because each machine could handle less simultaneous access. That is why your SQL parser project seems odd to me.
A SQL parser could even be used to generate XML schema files directly from SQL CREATE statements for those wanting to try MDB/Metabase.
This is a bit odd use. Anyway, there is now experimental reverse engineer support in Metabase that does not require any SQL parsing. It just uses the specific API functions for query schema metadata. Regards, Manuel Lemos


« previous php.pear.dev (#7600) next »