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/; |
2ad62d97 | 7 | use mro 'c3'; |
843f8ecd | 8 | |
18360aed | 9 | sub _rebless { |
9382ad07 | 10 | my ($self) = @_; |
843f8ecd | 11 | |
9ae966b9 | 12 | my $version = eval { $self->_get_dbh->get_info(18); }; |
0680ac39 | 13 | |
9382ad07 | 14 | if ( !$@ ) { |
15 | my ($major, $minor, $patchlevel) = split(/\./, $version); | |
843f8ecd | 16 | |
9382ad07 | 17 | # Default driver |
08fabf59 | 18 | my $class = $major <= 8 |
9382ad07 | 19 | ? 'DBIx::Class::Storage::DBI::Oracle::WhereJoins' |
20 | : 'DBIx::Class::Storage::DBI::Oracle::Generic'; | |
843f8ecd | 21 | |
37b17a93 | 22 | $self->ensure_class_loaded ($class); |
23 | bless $self, $class; | |
9382ad07 | 24 | } |
099049b5 | 25 | } |
26 | ||
843f8ecd | 27 | 1; |
28 | ||
75d07914 | 29 | =head1 NAME |
843f8ecd | 30 | |
18360aed | 31 | DBIx::Class::Storage::DBI::Oracle - Base class for Oracle driver |
843f8ecd | 32 | |
843f8ecd | 33 | =head1 DESCRIPTION |
34 | ||
18360aed | 35 | This class simply provides a mechanism for discovering and loading a sub-class |
08fabf59 | 36 | for a specific version Oracle backend. It should be transparent to the user. |
843f8ecd | 37 | |
08fabf59 | 38 | For Oracle major versions <= 8 it loads the ::Oracle::WhereJoins subclass, |
39 | which unrolls the ANSI join style DBIC normally generates into entries in | |
40 | the WHERE clause for compatibility purposes. To force usage of this version | |
41 | no matter the database version, add | |
42 | ||
43 | __PACKAGE__->storage_type('::DBI::Oracle::WhereJoins'); | |
44 | ||
45 | to your Schema class. | |
843f8ecd | 46 | |
18360aed | 47 | =head1 AUTHORS |
843f8ecd | 48 | |
18360aed | 49 | David Jack Olrik C<< <djo@cpan.org> >> |
843f8ecd | 50 | |
51 | =head1 LICENSE | |
52 | ||
53 | You may distribute this code under the same terms as Perl itself. | |
54 | ||
55 | =cut |