Commit | Line | Data |
---|---|---|
843f8ecd | 1 | package DBIx::Class::Storage::DBI::Oracle; |
e21dfd6a | 2 | # -*- mode: cperl; cperl-indent-level: 2 -*- |
3 | ||
843f8ecd | 4 | use strict; |
5 | use warnings; | |
6 | ||
18360aed | 7 | use base qw/DBIx::Class::Storage::DBI/; |
843f8ecd | 8 | |
18360aed | 9 | sub _rebless { |
e21dfd6a | 10 | my ($self) = @_; |
843f8ecd | 11 | |
e21dfd6a | 12 | my $version = eval { $self->_dbh->get_info(18); }; |
13 | unless ( $@ ) { | |
14 | my ($major,$minor,$patchlevel) = split(/\./,$version); | |
0680ac39 | 15 | |
e21dfd6a | 16 | # Default driver |
17 | my $class = "DBIx::Class::Storage::DBI::Oracle::Generic"; | |
843f8ecd | 18 | |
e21dfd6a | 19 | # Version specific drivers |
20 | $class = "DBIx::Class::Storage::DBI::Oracle::8" | |
21 | if $major == 8; | |
099049b5 | 22 | |
e21dfd6a | 23 | # Load and rebless |
24 | eval "require $class"; | |
25 | bless $self, $class unless $@; | |
26 | } | |
099049b5 | 27 | } |
28 | ||
29 | ||
843f8ecd | 30 | 1; |
31 | ||
75d07914 | 32 | =head1 NAME |
843f8ecd | 33 | |
18360aed | 34 | DBIx::Class::Storage::DBI::Oracle - Base class for Oracle driver |
843f8ecd | 35 | |
36 | =head1 SYNOPSIS | |
37 | ||
38 | # In your table classes | |
18360aed | 39 | __PACKAGE__->load_components(qw/Core/); |
843f8ecd | 40 | |
41 | =head1 DESCRIPTION | |
42 | ||
18360aed | 43 | This class simply provides a mechanism for discovering and loading a sub-class |
44 | for a specific version Oracle backend. It should be transparent to the user. | |
843f8ecd | 45 | |
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 |