1 package DBIx::Class::Schema::Loader::DBI::Sybase::Common;
5 use Carp::Clan qw/^DBIx::Class/;
8 our $VERSION = '0.04999_06';
12 DBIx::Class::Schema::Loader::DBI::Sybase::Common - Common functions for Sybase
17 See L<DBIx::Class::Schema::Loader::Base>.
21 # DBD::Sybase doesn't implement get_info properly
22 sub _build_quoter { '"' }
23 sub _build_namesep { '.' }
25 sub _set_quote_char_and_name_sep {
28 $self->schema->storage->sql_maker->quote_char([qw/[ ]/])
29 unless $self->schema->storage->sql_maker->quote_char;
31 $self->schema->storage->sql_maker->name_sep('.')
32 unless $self->schema->storage->sql_maker->name_sep;
35 sub _build_db_schema {
37 my $dbh = $self->schema->storage->dbh;
39 local $dbh->{FetchHashKeyName} = 'NAME_lc';
41 my $test_table = "_loader_test_$$";
43 my $db_schema = 'dbo'; # default
46 $dbh->do("create table $test_table (id integer)");
47 my $sth = $dbh->prepare('sp_tables');
49 while (my $row = $sth->fetchrow_hashref) {
50 next unless $row->{table_name} eq $test_table;
52 $db_schema = $row->{table_owner};
56 $dbh->do("drop table $test_table");
59 eval { $dbh->do("drop table $test_table") };
60 carp "Could not determine db_schema, defaulting to $db_schema : $exception"
68 L<DBIx::Class::Schema::Loader::DBI::Sybase>,
69 L<DBIx::Class::Schema::Loader::DBI::MSSQL>,
70 L<DBIx::Class::Schema::Loader::DBI>
71 L<DBIx::Class::Schema::Loader>, L<DBIx::Class::Schema::Loader::Base>,
75 Rafael Kitover <rkitover@cpan.org>