Re: SQL_Parser
| From: | Stefan Neufeind | Date: | Fri, 19 Dec 2003 16:12:35 +0000 |
| Subject: | Re: SQL_Parser | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-24541@lists.php.net to get a copy of this message | ||
A general parser could also include functionality to be able to even
transform queries from one database-system to another - emulating non-
existent features of one DBMS in another. Sure that would be hard to
do - but if you manage to get that working it would definitely be
cool :-)
For the current solution I agree that Formatter / Highlighter would
be a better name :-)
Stefan
On 19 Dec 2003 at 17:04, Norbert Mocsnik wrote:
> Cool idea but I'd prefer another package name, SQL_Formatter,
> SQL_Highlighter or whatever fits the standards. Parsing is much more
> than this.
>
> > About this package SQL, i was think a fucntion that would help me as
> > i made a class for debug infos.
> >
> > This function would take a query in param :
> >
> > function formatQueryString($Sql, $FormatMode)
> > {
> > ..
> > }
> >
> > Depending the FormatMode, the query would be returned
> > as formated test with indentation :
> >
> > // Silly example
> > formatQueryString("select * from User Where nUserID in ( Select
> > nUserID from user where nUserID = 12 )");
> >
> > The returned string would be :
> >
> > SELECT * FROM User
> > WHERE nUserID IN
> > ( SELECT nUserID
> > FROM User WHERE nUserID = 12 )
> >
> > We can imagine different modes, with html table, bold style
> > for SQL keyword and so on... It sould be usefull, what
> > do you think about it ?