Added Justin Wheeler's Oracle 8 support
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / Oracle.pm
1 package DBIx::Class::Storage::DBI::Oracle;
2 use strict;
3 use warnings;
4
5 use base qw/DBIx::Class::Storage::DBI/;
6
7 sub _rebless {
8     my ($self) = @_;
9
10     my $version = eval { $self->_dbh->get_info(18); };
11     unless ( $@ ) {
12         my ($major,$minor,$patchlevel) = split(/\./,$version);
13
14         # Default driver
15         my $class = "DBIx::Class::Storage::DBI::Oracle::Generic";
16
17         # Version specific drivers
18         $class = "DBIx::Class::Storage::DBI::Oracle::8"
19             if $major == 8;
20
21         # Load and rebless
22         eval "require $class";
23         bless $self, $class unless $@;
24     }
25 }
26
27
28 1;
29
30 =head1 NAME
31
32 DBIx::Class::Storage::DBI::Oracle - Base class for Oracle driver
33
34 =head1 SYNOPSIS
35
36   # In your table classes
37   __PACKAGE__->load_components(qw/Core/);
38
39 =head1 DESCRIPTION
40
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.
43
44
45 =head1 AUTHORS
46
47 David Jack Olrik C<< <djo@cpan.org> >>
48
49 =head1 LICENSE
50
51 You may distribute this code under the same terms as Perl itself.
52
53 =cut