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