$self->next::method(@_);
- $self->{db_schema} ||= $self->_determine_db_schema;
+ $self->{db_schema} ||= $self->_build_db_schema;
}
-sub _determine_db_schema {
+sub _build_db_schema {
my $self = shift;
my $dbh = $self->schema->storage->dbh;
my $test_table = "_loader_test_$$";
- $dbh->do("create table $test_table (id integer)");
my $db_schema = 'dbo'; # default
eval {
+ $dbh->do("create table $test_table (id integer)");
my $sth = $dbh->prepare('sp_tables');
$sth->execute;
while (my $row = $sth->fetchrow_hashref) {
last;
}
$sth->finish;
+ $dbh->do("drop table $test_table");
};
my $exception = $@;
- $dbh->do("drop table $test_table");
- croak $exception if $exception;
+ eval { $dbh->do("drop table $test_table") };
+ carp "Could not determine db_schema, defaulting to $db_schema : $exception"
+ if $exception;
return $db_schema;
}
my $tester = dbixcsl_common_tests->new(
vendor => 'Microsoft',
- quote_char => [qw/[ ]/],
auto_inc_pk => 'INTEGER IDENTITY NOT NULL PRIMARY KEY',
dsn => $dsn,
user => $user,
my $tester = dbixcsl_common_tests->new(
vendor => 'Microsoft',
- quote_char => [qw/[ ]/],
auto_inc_pk => 'INTEGER IDENTITY NOT NULL PRIMARY KEY',
dsn => $dsn,
user => $user,