X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FADO.pm;h=aa9fb5d19f1e51e799f620f6154c2f8d2d2fb4fb;hb=b9ca4ff1e045a7863033012e98dc83b5dc95e26e;hp=e457b9612340374bb6d5e55f9bccbbb0e694e72d;hpb=748eb62028de5636c4c25d2fa94ebb677ea8282a;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/Storage/DBI/ADO.pm b/lib/DBIx/Class/Storage/DBI/ADO.pm index e457b96..aa9fb5d 100644 --- a/lib/DBIx/Class/Storage/DBI/ADO.pm +++ b/lib/DBIx/Class/Storage/DBI/ADO.pm @@ -2,6 +2,8 @@ package # hide from PAUSE DBIx::Class::Storage::DBI::ADO; use base 'DBIx::Class::Storage::DBI'; +use Try::Tiny; +use namespace::clean; sub _rebless { my $self = shift; @@ -10,20 +12,18 @@ sub _rebless { # XXX This should be using an OpenSchema method of some sort, but I don't know # how. # Current version is stolen from Sybase.pm - my $dbtype = eval { - @{$self->_get_dbh + try { + my $dbtype = @{$self->_get_dbh ->selectrow_arrayref(qq{sp_server_info \@attribute_id=1}) - }[2] - }; + }[2]; - unless ($@) { $dbtype =~ s/\W/_/gi; my $subclass = "DBIx::Class::Storage::DBI::ADO::${dbtype}"; if ($self->load_optional_class($subclass) && !$self->isa($subclass)) { bless $self, $subclass; $self->_rebless; } - } + }; } # Here I was just experimenting with ADO cursor types, left in as a comment in