The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Rosetta::Utility::SQLParser - Parse ANSI/ISO SQL:2003 and other SQL variants

VERSION

This document describes Rosetta::Utility::SQLParser version 0.3.0.

SYNOPSIS

This documentation section will be written later.

DESCRIPTION

This module is a reference implementation of fundamental Rosetta::Model features.

The Rosetta::Utility::SQLParser Perl 5 module is a functional but quickly built Rosetta::Model utility class that converts one or more SQL strings into a set of related Rosetta::Model Nodes that are functionally equivalent, and can be used for a variety of tasks that SQL would normally be used with, but saving the users from having to parse the string SQL themselves. This class will parse multiple string SQL variants; usually it can determine the intent of a SQL string based soley from examining the string itself, but in cases where the string is ambiguous as to what SQL variant it is, this class takes arguments that let you give it hints to resolve the ambiguity; by default it will resolve ambiguities by whatever decision results in something closer to the ANSI/ISO SQL:2003 (or 1999 or 1992) standard.

Rosetta::Utility::SQLParser is designed to implement common functionality for multiple Rosetta Engine classes (such as Rosetta::Engine::Generic) allowing them to focus more on the non-SQL specific aspects of their work. A Rosetta Engine would typically invoke this class when reverse-engineering a database schema where the database returns the schema object descriptors as SQL strings ('create' statements usually) rather than the information being in an "information schema". This class can also be used by code on the application-side of a Rosetta::Interface tree (such as Rosetta::Emulator::DBI); for example, a module that emulates an older database interface which wants to accept database commands as SQL strings can use this module to parse those. (For your reference, see also the Rosetta::Utility::SQLBuilder module, which implements the inverse functionality to SQLParser, and is used in both of the same places.)

CAVEAT: SIGNIFICANT PORTIONS OF THIS MODULE ARE NOT WRITTEN YET.

CONSTRUCTOR FUNCTIONS

This function is stateless and can be invoked off of either this module's name or an existing module object, with the same result.

new()

    my $parser = Rosetta::Utility::SQLParser->new();
    my $parser2 = $parser->new();

This "getter" function/method will create and return a single Rosetta::Utility::SQLParser (or subclass) object. All of this object's properties are set to default values that should cause the object to resolve SQL parsing ambiguities in a manner leaning towards the SQL:2003 standard.

DEPENDENCIES

This module requires any version of Perl 5.x.y that is at least 5.8.1.

It also requires the Perl modules version and only, which would conceptually be built-in to Perl, but aren't, so they are on CPAN instead.

It also requires these modules that are on CPAN: Locale::KeyedText '1.6.0-' (for error messages), Rosetta::Model '0.71.0-'.

INCOMPATIBILITIES

None reported.

SEE ALSO

perl(1), Rosetta::Utility::SQLParser::L::en, Locale::KeyedText, Rosetta::Model, Rosetta::Utility::SQLBuilder, Rosetta::Engine::Generic, Rosetta::Emulator::DBI, DBIx::MyParse.

BUGS AND LIMITATIONS

This module is currently in pre-alpha development status, meaning that some parts of it will be changed in the near future, perhaps in incompatible ways.

AUTHOR

Darren R. Duncan (perl@DarrenDuncan.net)

LICENCE AND COPYRIGHT

This file is part of the Rosetta::Utility::SQLParser reference implementation of a SQL:2003 string parser that uses the Rosetta::Model database portability library.

Rosetta::Utility::SQLParser is Copyright (c) 2002-2005, Darren R. Duncan. All rights reserved. Address comments, suggestions, and bug reports to perl@DarrenDuncan.net, or visit http://www.DarrenDuncan.net/ for more information.

Rosetta::Utility::SQLParser is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (GPL) as published by the Free Software Foundation (http://www.fsf.org/); either version 2 of the License, or (at your option) any later version. You should have received a copy of the GPL as part of the Rosetta::Utility::SQLParser distribution, in the file named "GPL"; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.

Linking Rosetta::Utility::SQLParser statically or dynamically with other modules is making a combined work based on Rosetta::Utility::SQLParser. Thus, the terms and conditions of the GPL cover the whole combination. As a special exception, the copyright holders of Rosetta::Utility::SQLParser give you permission to link Rosetta::Utility::SQLParser with independent modules, regardless of the license terms of these independent modules, and to copy and distribute the resulting combined work under terms of your choice, provided that every copy of the combined work is accompanied by a complete copy of the source code of Rosetta::Utility::SQLParser (the version of Rosetta::Utility::SQLParser used to produce the combined work), being distributed under the terms of the GPL plus this exception. An independent module is a module which is not derived from or based on Rosetta::Utility::SQLParser, and which is fully useable when not linked to Rosetta::Utility::SQLParser in any form.

Any versions of Rosetta::Utility::SQLParser that you modify and distribute must carry prominent notices stating that you changed the files and the date of any changes, in addition to preserving this original copyright notice and other credits. Rosetta::Utility::SQLParser 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.

While it is by no means required, the copyright holders of Rosetta::Utility::SQLParser would appreciate being informed any time you create a modified version of Rosetta::Utility::SQLParser that you are willing to distribute, because that is a practical way of suggesting improvements to the standard version.