package SQL::Translator::Parser;
# ----------------------------------------------------------------------
-# $Id: Parser.pm,v 1.1.1.1.2.2 2002-03-21 15:47:08 dlc Exp $
+# $Id: Parser.pm,v 1.6 2003-01-27 17:04:44 dlc Exp $
# ----------------------------------------------------------------------
-# Copyright (C) 2002 Ken Y. Clark <kycl4rk@users.sourceforge.net>,
-# darren chamberlain <darren@cpan.org>
+# Copyright (C) 2003 Ken Y. Clark <kclark@cpan.org>,
+# darren chamberlain <darren@cpan.org>,
+# Chris Mungall <cjm@fruitfly.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
use strict;
use vars qw( $VERSION );
-$VERSION = sprintf "%d.%02d", q$Revision: 1.1.1.1.2.2 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.6 $ =~ /(\d+)\.(\d+)/;
sub parse { "" }
1;
-#-----------------------------------------------------
+# ----------------------------------------------------------------------
# Enough! or Too much.
# William Blake
-#-----------------------------------------------------
-__END__
+# ----------------------------------------------------------------------
+
+=pod
=head1 NAME
example, if the database does not have multiple options). For MySQL,
this value might include MyISAM, HEAP, or similar.
-=item B<indeces>
+=item B<indices>
-The indeces keys is a reference to an array of hashrefs. Each hashref
+The indices keys is a reference to an array of hashrefs. Each hashref
defines one index, and has the keys 'name' (if defined, it will be a
string), 'type' (a string), and 'fields' (a reference to another
array). For example, a table in a MySQL database with two indexes,
KEY foo_idx (foo),
KEY foo_bar_idx (foo, bar),
-would be described in the indeces element as:
+would be described in the indices element as:
[
{
{
type => 'field',
+ order => 1, # the order in the original table
name => '', # same as the key
data_type => '', # in the db's jargon,
# i.e., MySQL => int, Oracale => INTEGER
'fields => {
'username' => {
type => 'field',
+ order => 1,
name => 'username',
data_type => 'char',
size => '8',
is_primary_key => undef,
},
},
- 'indeces' => [
+ 'indices' => [
{
'name' => 'username_idx',
'fields' => [
=head1 AUTHORS
-Ken Y. Clark, E<lt>kclark@logsoft.comE<gt>, darren chamberlain E<lt>darren@cpan.orgE<gt>
+Ken Y. Clark, E<lt>kclark@cpan.org<gt>,
+darren chamberlain E<lt>darren@cpan.orgE<gt>.
=head1 SEE ALSO