sub compose_connection {
my ($self, $target, @info) = @_;
- warn "compose_connection deprecated as of 0.08000" unless $warn++;
+ warn "compose_connection deprecated as of 0.08000"
+ unless ($INC{"DBIx/Class/CDBICompat.pm"} || $warn++);
my $base = 'DBIx::Class::ResultSetProxy';
eval "require ${base};";
# but not in the coderef case, obviously.
if(ref $info->[0] ne 'CODE') {
$last_info = $info->[3];
-
warn "You *really* should explicitly set AutoCommit "
. "(preferably to 1) in your db connect info"
if !$last_info
my $dbuser = $ENV{"DBICTEST_DBUSER"} || '';
my $dbpass = $ENV{"DBICTEST_DBPASS"} || '';
- my $compose_method = ($args{compose_connection}
- ? 'compose_connection'
- : 'compose_namespace');
+ my $schema;
- my $schema = DBICTest::Schema->$compose_method('DBICTest')
- ->connect($dsn, $dbuser, $dbpass, { AutoCommit => 1 });
+ my @connect_info = ($dsn, $dbuser, $dbpass, { AutoCommit => 1 });
+
+ if ($args{compose_connection}) {
+ $schema = DBICTest::Schema->compose_connection(
+ 'DBICTest', @connect_info
+ );
+ } else {
+ $schema = DBICTest::Schema->compose_namespace('DBICTest')
+ ->connect(@connect_info);
+ }
$schema->storage->on_connect_do(['PRAGMA synchronous = OFF']);
if ( !$args{no_deploy} ) {
__PACKAGE__->deploy_schema( $schema );