1 package DBIx::Class::Storage::DBI::ADO;
3 use base 'DBIx::Class::Storage::DBI';
10 DBIx::Class::Storage::DBI::ADO - Support for L<DBD::ADO>
14 This class provides a mechanism for discovering and loading a sub-class
15 for a specific ADO backend, as well as some workarounds for L<DBD::ADO>. It
16 should be transparent to the user.
23 my $dbtype = $self->_dbh_get_info(17);
26 warn 'Unable to determine ADO driver, failling back to generic support';
31 my $subclass = "DBIx::Class::Storage::DBI::ADO::${dbtype}";
32 if ($self->load_optional_class($subclass) && !$self->isa($subclass)) {
33 bless $self, $subclass;
38 # cleanup some warnings from DBD::ADO
39 # RT#65563, not fixed as of DBD::ADO v2.98
43 my $warn_handler = $SIG{__WARN__} || sub { warn @_ };
45 local $SIG{__WARN__} = sub {
47 unless $_[0] =~ m{^Missing argument in sprintf at \S+/ADO/GetInfo\.pm};
50 $self->next::method(@_);
53 # Here I was just experimenting with ADO cursor types, left in as a comment in
54 # case you want to as well. See the DBD::ADO docs.
56 # my ($self, $dbh, $sql) = @_;
58 # my $sth = $self->disable_sth_caching
59 # ? $dbh->prepare($sql, { CursorType => 'adOpenStatic' })
60 # : $dbh->prepare_cached($sql, { CursorType => 'adOpenStatic' }, 3);
62 # $self->throw_exception($dbh->errstr) if !$sth;
71 See L<DBIx::Class/AUTHOR> and L<DBIx::Class/CONTRIBUTORS>.
75 You may distribute this code under the same terms as Perl itself.