Re: feature request for SQL::Statement::Structure

Darren Duncan <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Message-ID <[email protected]>
Tim Bunce wrote:
> With regard to migrating SQL::Statement to be built on SQL::Translator,
> that's clearly a big task, but one that I presume could be broken down
> into smaller tasks.

I think that it might work better to treat SQL like a general purpose 
programming language, as much as is possible, rather than something inordinately 
special, and then use that as a starting point from which to design and build a 
parser for it.

For example, think of your "create table" et al like a data type definition 
(columns are attributes, constraints are constraints, etc) plus variable 
declaration, and think of your "select" etc like a value expression, and so on; 
stored procedures etc are routine definitions; bind parameters are parameters.

Perhaps something like PPI might be a better starting point (this is a stab in 
the dark) as it is designed for a full language.

That's what I would do if I were making a SQL parser.  Oh wait, I am!

-- Darren Duncan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.