Release 0.07047
[dbsrgits/DBIx-Class-Schema-Loader.git] / lib / DBIx / Class / Schema / Loader / DBI / Sybase / Common.pm
1 package DBIx::Class::Schema::Loader::DBI::Sybase::Common;
2
3 use strict;
4 use warnings;
5 use base 'DBIx::Class::Schema::Loader::DBI';
6 use mro 'c3';
7
8 our $VERSION = '0.07047';
9
10 =head1 NAME
11
12 DBIx::Class::Schema::Loader::DBI::Sybase::Common - Common methods for Sybase
13 and MSSQL
14
15 =head1 DESCRIPTION
16
17 See L<DBIx::Class::Schema::Loader> and L<DBIx::Class::Schema::Loader::Base>.
18
19 =cut
20
21 # DBD::Sybase doesn't implement get_info properly
22 sub _build_quote_char { '[]' }
23 sub _build_name_sep   { '.'  }
24
25 sub _setup {
26     my $self = shift;
27
28     $self->next::method(@_);
29
30     $self->schema->storage->sql_maker->quote_char([qw/[ ]/]);
31     $self->schema->storage->sql_maker->name_sep('.');
32 }
33
34 # remove 'IDENTITY' from column data_type
35 sub _columns_info_for {
36     my $self   = shift;
37     my $result = $self->next::method(@_);
38
39     foreach my $col (keys %$result) {
40         $result->{$col}->{data_type} =~ s/\s* identity \s*//ix;
41     }
42
43     return $result;
44 }
45
46 =head1 SEE ALSO
47
48 L<DBIx::Class::Schema::Loader::DBI::Sybase>,
49 L<DBIx::Class::Schema::Loader::DBI::MSSQL>,
50 L<DBIx::Class::Schema::Loader::DBI::ODBC::Microsoft_SQL_Server>,
51 L<DBIx::Class::Schema::Loader::DBI::Sybase::Microsoft_SQL_Server>,
52 L<DBIx::Class::Schema::Loader::DBI>
53 L<DBIx::Class::Schema::Loader>, L<DBIx::Class::Schema::Loader::Base>,
54
55 =head1 AUTHORS
56
57 See L<DBIx::Class::Schema::Loader/AUTHORS>.
58
59 =head1 LICENSE
60
61 This library is free software; you can redistribute it and/or modify it under
62 the same terms as Perl itself.
63
64 =cut
65
66 1;