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