package SQL::Translator::Producer::Dumper;
# -------------------------------------------------------------------
-# $Id: Dumper.pm,v 1.1 2004-03-09 19:14:42 kycl4rk Exp $
+# $Id: Dumper.pm,v 1.2 2004-03-09 19:35:40 kycl4rk Exp $
# -------------------------------------------------------------------
# Copyright (C) 2002-4 SQLFairy Authors
#
Options:
- add-truncate Add "TRUNCATE TABLE" statements for each table
db_user Database username
db_password Database password
dsn DSN for DBI
use Data::Dumper;
-$VERSION = sprintf "%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.2 $ =~ /(\d+)\.(\d+)/;
sub produce {
my $t = shift;
END
-%]
-my $db = DBI->connect('[% dsn %]', '[% db_user %]', '[% db_pass %]');
+my $db = DBI->connect(
+ '[% dsn %]',
+ '[% db_user %]',
+ '[% db_pass %]',
+ { RaiseError => 1 }
+);
my %skip = map { $_, 1 } map { s/^\s+|\s+$//; $_ } split (/,/, $skip);
my @tables = (
[%- FOREACH t IN table_defs %]