Genezzo::Parse::SQL - SQL parser


Genezzo documentation  | view source Contained in the Genezzo distribution.

Index


NAME

Top

Genezzo::Parse::SQL - SQL parser

SYNOPSIS

Top

 use Genezzo::Parse::SQL;
 use Parse::RecDescent;
 use Data::Dumper;

 # load the precompiled parser
 my $parser   = Genezzo::Parse::SQL->new();

 # sql_000 is parser entry point.
 # The argument is a string which contains a SQL query
 # (without a trailing semicolon).
 # The output is nested hash structure of the abstract 
 # syntax tree.
 my $sql_tree = $parser->sql_000($some_sql_statement);

 # dump out the parse tree
 print Data::Dumper->Dumper([$sql_tree],['sql_tree']);




DESCRIPTION

Top

  The SQL parser is a L<Parse::RecDescent> parser generated by 
  L<Genezzo::Parse::SQLGrammar>.  It shouldn't be looked at with
  human eyes.  

  Still reading this?  You must be a glutton for punishment.

  This parser handles a fair bit of SQL92, but the error handling
  is somewhat lacking.

ARGUMENTS

Top

FUNCTIONS

Top

EXPORT

LIMITATIONS

Top

 No support for DDL, ANSI Interval, Date, Timestamp, etc.

TODO

Top

alter table (elcaro MODIFY column NOT NULL) vs (sql3 ALTER COLUMN)...
Support for DDL, ANSI Interval, Date, Timestamp, etc.
fix the extra array deref in join rules
error messages everywhere
ECOUNT reserved word issues
TRIM, UPPER, etc in standard function list?
use of negative lookahead in reserved_word regex?
table constraint, storage clause
constraint attributes - deferrable, disable
delete cascade referential action
maybe can collapse qualified join with qj_leftop?
table expr optional column list
"system" literals like USER, SYSDATE
better separation of strings and numbers (see concatenate)
leading NOT
double colon in function names?

AUTHOR

Top

Jeffrey I. Cohen, jcohen@genezzo.com

SEE ALSO

Top

perl(1).

Copyright (c) 2005,2006 Jeffrey I Cohen. All rights reserved.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

Address bug reports and comments to: jcohen@genezzo.com

For more information, please visit the Genezzo homepage at http://www.genezzo.com


Genezzo documentation  | view source Contained in the Genezzo distribution.