something apparently working
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / ADO.pm
1 package # hide from PAUSE
2     DBIx::Class::Storage::DBI::ADO;
3
4 use base 'DBIx::Class::Storage::DBI';
5
6 sub _rebless {
7   my $self = shift;
8
9 # check for MSSQL
10 # XXX This should be using an OpenSchema method of some sort, but I don't know
11 # how.
12 # Current version is stolen from Sybase.pm
13   my $dbtype = eval {
14     @{$self->_get_dbh
15       ->selectrow_arrayref(qq{sp_server_info \@attribute_id=1})
16     }[2]
17   };
18
19   unless ($@) {
20     $dbtype =~ s/\W/_/gi;
21     my $subclass = "DBIx::Class::Storage::DBI::ADO::${dbtype}";
22     if ($self->load_optional_class($subclass) && !$self->isa($subclass)) {
23       bless $self, $subclass;
24       $self->_rebless;
25     }
26   }
27 }
28
29 # set cursor type here, if necessary
30 #sub _dbh_sth {
31 #  my ($self, $dbh, $sql) = @_;
32 #
33 #  my $sth = $self->disable_sth_caching
34 #    ? $dbh->prepare($sql, { CursorType => 'adOpenStatic' })
35 #    : $dbh->prepare_cached($sql, { CursorType => 'adOpenStatic' }, 3);
36 #
37 #  $self->throw_exception($dbh->errstr) if !$sth;
38 #
39 #  $sth;
40 #}
41
42 1;