release 0.07008
[dbsrgits/DBIx-Class-Schema-Loader.git] / lib / DBIx / Class / Schema / Loader / DBI / ADO.pm
CommitLineData
3b17d988 1package DBIx::Class::Schema::Loader::DBI::ADO;
2
3use strict;
4use warnings;
5use base 'DBIx::Class::Schema::Loader::DBI';
6use mro 'c3';
7use Carp::Clan qw/^DBIx::Class/;
8use namespace::clean;
9
3bdcf490 10our $VERSION = '0.07008';
3b17d988 11
12=head1 NAME
13
14DBIx::Class::Schema::Loader::DBI::ADO - L<DBD::ADO> proxy
15
16=head1 DESCRIPTION
17
18Reblesses into an C<::ADO::> class when connecting via L<DBD::ADO>.
19
20See L<DBIx::Class::Schema::Loader::Base> for usage information.
21
22=cut
23
24sub _rebless {
25 my $self = shift;
26
27 return if ref $self ne __PACKAGE__;
28
29 my $dbh = $self->schema->storage->dbh;
30 my $dbtype = eval { $dbh->get_info(17) };
31 unless ( $@ ) {
32 # Translate the backend name into a perl identifier
33 $dbtype =~ s/\W/_/gi;
34 my $class = "DBIx::Class::Schema::Loader::DBI::ADO::${dbtype}";
35 if ($self->load_optional_class($class) && !$self->isa($class)) {
36 bless $self, $class;
37 $self->_rebless;
38 }
39 }
40}
41
42sub _tables_list {
43 my ($self, $opts) = @_;
44
45 return $self->next::method($opts, undef, undef);
46}
47
48sub _filter_tables {
49 my $self = shift;
50
51 local $^W = 0; # turn off exception printing from Win32::OLE
52
53 $self->next::method(@_);
54}
55
56=head1 SEE ALSO
57
58L<DBIx::Class::Schema::Loader::DBI::ADO::Microsoft_SQL_Server>,
59L<DBIx::Class::Schema::Loader::DBI::ADO::MS_Jet>,
60L<DBIx::Class::Schema::Loader>, L<DBIx::Class::Schema::Loader::Base>,
61L<DBIx::Class::Schema::Loader::DBI>
62
63=head1 AUTHOR
64
65See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
66
67=head1 LICENSE
68
69This library is free software; you can redistribute it and/or modify it under
70the same terms as Perl itself.
71
72=cut
73
741;