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