package SQL::Translator::Parser::MySQL;
# -------------------------------------------------------------------
-# $Id: MySQL.pm,v 1.17 2003-05-09 16:55:07 kycl4rk Exp $
+# $Id: MySQL.pm,v 1.18 2003-05-09 19:51:04 kycl4rk Exp $
# -------------------------------------------------------------------
# Copyright (C) 2003 Ken Y. Clark <kclark@cpan.org>,
# darren chamberlain <darren@cpan.org>,
use strict;
use vars qw[ $DEBUG $VERSION $GRAMMAR @EXPORT_OK ];
-$VERSION = sprintf "%d.%02d", q$Revision: 1.17 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.18 $ =~ /(\d+)\.(\d+)/;
$DEBUG = 0 unless defined $DEBUG;
use Data::Dumper;
# -------------------------------------------------------------------
sub parse {
- my ( $translator, $data, $schema ) = @_;
+ my ( $translator, $data ) = @_;
$parser ||= Parse::RecDescent->new($GRAMMAR);
local $::RD_TRACE = $translator->trace ? 1 : undef;
die "Parse failed.\n" unless defined $result;
warn Dumper( $result ) if $DEBUG;
+ my $schema = $translator->schema;
for my $table_name ( keys %{ $result } ) {
my $tdata = $result->{ $table_name };
my $table = $schema->add_table(
package SQL::Translator::Parser::xSV;
# -------------------------------------------------------------------
-# $Id: xSV.pm,v 1.7 2003-05-09 17:15:30 kycl4rk Exp $
+# $Id: xSV.pm,v 1.8 2003-05-09 19:51:04 kycl4rk Exp $
# -------------------------------------------------------------------
# Copyright (C) 2003 Ken Y. Clark <kclark@cpan.org>,
# darren chamberlain <darren@cpan.org>
use strict;
use vars qw($VERSION @EXPORT);
-$VERSION = sprintf "%d.%02d", q$Revision: 1.7 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.8 $ =~ /(\d+)\.(\d+)/;
use Exporter;
use Text::ParseWords qw(quotewords);
# Passed a SQL::Translator instance and a string containing the data
#
sub parse {
- my ($tr, $data, $schema) = @_;
+ my ( $tr, $data ) = @_;
my $args = $tr->parser_args;
my $parser = Text::RecordParser->new(
field_separator => $args->{'field_separator'} || ',',
},
};
+ my $schema = $tr->schema;
my $table = $schema->add_table( name => 'table1' );
#