package SQL::Translator::Producer::Turnkey;
# -------------------------------------------------------------------
-# $Id: Turnkey.pm,v 1.17 2004-01-03 03:13:39 boconnor Exp $
+# $Id: Turnkey.pm,v 1.18 2004-01-03 04:03:56 allenday Exp $
# -------------------------------------------------------------------
# Copyright (C) 2003 Allen Day <allenday@ucla.edu>,
# Brian O'Connor <brian.oconnor@excite.com>.
use strict;
use vars qw[ $VERSION $DEBUG ];
-$VERSION = sprintf "%d.%02d", q$Revision: 1.17 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.18 $ =~ /(\d+)\.(\d+)/;
$DEBUG = 1 unless defined $DEBUG;
use SQL::Translator::Schema::Constants;
format_fk => $t->format_fk_name,
template => $args->{'template'} || '',
baseclass => $baseclass,
+ db_dsn => $args->{'db_dsn'} || '',
db_user => $args->{'db_user'} || '',
db_pass => $args->{'db_pass'} || '',
db_str => $args->{'db_str'} || '',
if($type eq 'dbi'){
return <<EOF;
-
-# MACRO
-
[% MACRO printPackage(node) BLOCK %]
# --------------------------------------------
use strict;
use base qw(Class::DBI::Pg);
-[% baseclass %]->set_db('Main', '[% db_str %]', '[% db_user %]', '[% db_pass %]');
+[% baseclass %]->set_db('Main', '[% db_dsn %]', '[% db_user %]', '[% db_pass %]', {AutoCommit=>1});
[% FOREACH node = nodes %]
[% printPackage(node.value) %]
[% pname = node.value.name FILTER replace "Turnkey::Model::", "" %]
-
use base qw(Turnkey::Atom);
use Data::Dumper;