is_foreign_key_constrain to allow explicit control over wether or
not a foreign constraint is needed
- resultset_class/result_class now (again) auto loads the specified
- class; requires Class::Accessor::Grouped 0.05001+
+ class; requires Class::Accessor::Grouped 0.05002+
0.07006 2007-04-17 23:18:00
- Lots of documentation updates
requires 'DBI' => 1.40;
requires 'Module::Find' => 0;
requires 'Class::Inspector' => 0;
-requires 'Class::Accessor::Grouped' => 0.05001;
+requires 'Class::Accessor::Grouped' => 0.05002;
requires 'JSON' => 1.00;
# Perl 5.8.0 doesn't have utf8::is_utf8()
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};";
recommend that you always explicitly set C<AutoCommit> to either
C<0> or C<1>. L<DBIx::Class> further recommends that it be set
to C<1>, and that you perform transactions via our L</txn_do>
-method. L<DBIx::Class> will emit a warning if you fail to explicitly
-set C<AutoCommit> one way or the other. See below for more details.
+method. L<DBIx::Class> will set it to C<1> if you do not do explicitly
+set it to zero. This is the default for most DBDs. See below for more
+details.
In either case, if the final argument in your connect_info happens
to be a hashref, C<connect_info> will look there for several
pop(@$info) if !keys %$last_info;
}
- # Now check the (possibly new) final argument for AutoCommit,
- # but not in the coderef case, obviously.
if(ref $info->[0] ne 'CODE') {
- $last_info = $info->[3];
+ # Extend to 3 arguments with undefs, if necessary
+ while(scalar(@$info) < 3) { push(@$info, undef) }
- warn "You *really* should explicitly set AutoCommit "
- . "(preferably to 1) in your db connect info"
- if !$last_info
- || ref $last_info ne 'HASH'
- || !defined $last_info->{AutoCommit};
+ # Complain if 4th argument is defined and is not a HASH
+ if(defined $info->[3] && ref $info->[3] ne 'HASH') {
+ warn "4th argument of DBI connect info is defined "
+ . " but is not a hashref!";
+ }
+
+ # Set AutoCommit to 1 if not specified manually
+ else {
+ $info->[3] ||= {};
+ if(!defined $info->[3]->{AutoCommit}) {
+ $info->[3]->{AutoCommit} = 1;
+ }
+ }
}
$self->_connect_info($info);
die "Can't handle full outer joins in Oracle 8 yet!\n"
if $to_jt->{-join_type} =~ /full/i;
- $left_join = q{(+)} if $to_jt->{-join_type} =~ /right/i
+ $left_join = q{(+)} if $to_jt->{-join_type} =~ /left/i
&& $to_jt->{-join_type} !~ /inner/i;
- $right_join = q{(+)} if $to_jt->{-join_type} =~ /left/i
+ $right_join = q{(+)} if $to_jt->{-join_type} =~ /right/i
&& $to_jt->{-join_type} !~ /inner/i;
}
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 );