1 package SQL::Translator::Parser::DBI::SQLite;
3 # -------------------------------------------------------------------
4 # $Id: SQLite.pm,v 1.3 2003-10-03 19:47:19 kycl4rk Exp $
5 # -------------------------------------------------------------------
6 # Copyright (C) 2003 Ken Y. Clark <kclark@cpan.org>.
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; version 2.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21 # -------------------------------------------------------------------
25 SQL::Translator::Parser::DBI::SQLite - parser for DBD::SQLite
29 See SQL::Translator::Parser::DBI.
33 Queries the "sqlite_master" table for schema definition.
39 use SQL::Translator::Parser::SQLite;
42 use vars qw[ $DEBUG $VERSION @EXPORT_OK ];
43 $VERSION = sprintf "%d.%02d", q$Revision: 1.3 $ =~ /(\d+)\.(\d+)/;
44 $DEBUG = 0 unless defined $DEBUG;
46 # -------------------------------------------------------------------
48 my ( $tr, $dbh ) = @_;
50 my $create = join(";\n",
52 @{ $dbh->selectcol_arrayref('select sql from sqlite_master') },
55 $tr->debug( "create =\n$create\n" );
57 my $schema = $tr->schema;
59 SQL::Translator::Parser::SQLite::parse( $tr, $create );
65 # -------------------------------------------------------------------
66 # Where man is not nature is barren.
68 # -------------------------------------------------------------------
74 Ken Y. Clark E<lt>kclark@cpan.orgE<gt>.
78 perl(1), Parse::RecDescent, SQL::Translator::Schema.