Release 0.07047
[dbsrgits/DBIx-Class-Schema-Loader.git] / lib / DBIx / Class / Schema / Loader / DBI / Sybase / Common.pm
index 609d9cb..19da343 100644 (file)
@@ -3,10 +3,9 @@ package DBIx::Class::Schema::Loader::DBI::Sybase::Common;
 use strict;
 use warnings;
 use base 'DBIx::Class::Schema::Loader::DBI';
-use Carp::Clan qw/^DBIx::Class/;
 use mro 'c3';
 
-our $VERSION = '0.07001';
+our $VERSION = '0.07047';
 
 =head1 NAME
 
@@ -20,8 +19,8 @@ See L<DBIx::Class::Schema::Loader> and L<DBIx::Class::Schema::Loader::Base>.
 =cut
 
 # DBD::Sybase doesn't implement get_info properly
-sub _build_quoter  { '"' }
-sub _build_namesep { '.' }
+sub _build_quote_char { '[]' }
+sub _build_name_sep   { '.'  }
 
 sub _setup {
     my $self = shift;
@@ -30,38 +29,6 @@ sub _setup {
 
     $self->schema->storage->sql_maker->quote_char([qw/[ ]/]);
     $self->schema->storage->sql_maker->name_sep('.');
-    $self->{db_schema} ||= $self->_build_db_schema;
-}
-
-sub _build_db_schema {
-    my $self = shift;
-    my $dbh  = $self->schema->storage->dbh;
-
-    local $dbh->{FetchHashKeyName} = 'NAME_lc';
-    
-    my $test_table = "_loader_test_$$";
-
-    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) {
-            next unless $row->{table_name} eq $test_table;
-
-            $db_schema = $row->{table_owner};
-            last;
-        }
-        $sth->finish;
-        $dbh->do("drop table $test_table");
-    };
-    my $exception = $@;
-    eval { $dbh->do("drop table $test_table") };
-    carp "Could not determine db_schema, defaulting to $db_schema : $exception"
-        if $exception;
-
-    return $db_schema;
 }
 
 # remove 'IDENTITY' from column data_type
@@ -85,9 +52,9 @@ L<DBIx::Class::Schema::Loader::DBI::Sybase::Microsoft_SQL_Server>,
 L<DBIx::Class::Schema::Loader::DBI>
 L<DBIx::Class::Schema::Loader>, L<DBIx::Class::Schema::Loader::Base>,
 
-=head1 AUTHOR
+=head1 AUTHORS
 
-See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+See L<DBIx::Class::Schema::Loader/AUTHORS>.
 
 =head1 LICENSE