Commit | Line | Data |
---|---|---|
843f8ecd | 1 | package DBIx::Class::Storage::DBI::Oracle; |
843f8ecd | 2 | use strict; |
3 | use warnings; | |
4 | ||
18360aed | 5 | use base qw/DBIx::Class::Storage::DBI/; |
843f8ecd | 6 | |
18360aed | 7 | sub _rebless { |
8 | my ($self) = @_; | |
843f8ecd | 9 | |
18360aed | 10 | my $version = eval { $self->_dbh->get_info(18); }; |
11 | unless ( $@ ) { | |
12 | my ($major,$minor,$patchlevel) = split(/\./,$version); | |
0680ac39 | 13 | |
18360aed | 14 | # Default driver |
15 | my $class = "DBIx::Class::Storage::DBI::Oracle::Generic"; | |
843f8ecd | 16 | |
18360aed | 17 | # Version specific drivers |
18 | $class = "DBIx::Class::Storage::DBI::Oracle::8" | |
19 | if $major == 8; | |
099049b5 | 20 | |
18360aed | 21 | # Load and rebless |
22 | eval "require $class"; | |
23 | bless $self, $class unless $@; | |
24 | } | |
099049b5 | 25 | } |
26 | ||
27 | ||
843f8ecd | 28 | 1; |
29 | ||
75d07914 | 30 | =head1 NAME |
843f8ecd | 31 | |
18360aed | 32 | DBIx::Class::Storage::DBI::Oracle - Base class for Oracle driver |
843f8ecd | 33 | |
34 | =head1 SYNOPSIS | |
35 | ||
36 | # In your table classes | |
18360aed | 37 | __PACKAGE__->load_components(qw/Core/); |
843f8ecd | 38 | |
39 | =head1 DESCRIPTION | |
40 | ||
18360aed | 41 | This class simply provides a mechanism for discovering and loading a sub-class |
42 | for a specific version Oracle backend. It should be transparent to the user. | |
843f8ecd | 43 | |
843f8ecd | 44 | |
18360aed | 45 | =head1 AUTHORS |
843f8ecd | 46 | |
18360aed | 47 | David Jack Olrik C<< <djo@cpan.org> >> |
843f8ecd | 48 | |
49 | =head1 LICENSE | |
50 | ||
51 | You may distribute this code under the same terms as Perl itself. | |
52 | ||
53 | =cut |