X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FLoader%2FDBI%2FADO%2FMS_Jet.pm;h=e494412c50210ebf730a30a174204488220bf697;hb=8e6c80c9ded48d2f9450de4200c4490b13d0c942;hp=bc0c0e242b0bdb324b0e9743f833d30f2fb3582a;hpb=c8845f2e67c636fbfb597a4562847cc80c4e5f28;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/lib/DBIx/Class/Schema/Loader/DBI/ADO/MS_Jet.pm b/lib/DBIx/Class/Schema/Loader/DBI/ADO/MS_Jet.pm index bc0c0e2..e494412 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/ADO/MS_Jet.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/ADO/MS_Jet.pm @@ -7,11 +7,10 @@ use base qw/ DBIx::Class::Schema::Loader::DBI::ODBC::ACCESS /; use mro 'c3'; -use Carp::Clan qw/^DBIx::Class/; use Try::Tiny; use namespace::clean; -our $VERSION = '0.07009'; +our $VERSION = '0.07011'; =head1 NAME @@ -124,23 +123,7 @@ sub _columns_info_for { while (my ($col, $info) = each %$result) { my $data_type = $info->{data_type}; - my $col_obj; - - my $cols = $self->_adox_catalog->Tables->Item($table)->Columns; - - for my $col_idx (0..$cols->Count-1) { - $col_obj = $cols->Item($col_idx); - if ($self->preserve_case) { - last if $col_obj->Name eq $col; - } - else { - last if lc($col_obj->Name) eq lc($col); - } - } - - if ($col_obj->Attributes | 2 == 2) { - $info->{is_nullable} = 1; - } + my $col_obj = $self->_adox_column($table, $col); if ($data_type eq 'long') { $info->{data_type} = 'integer'; @@ -194,7 +177,6 @@ sub _columns_info_for { $info->{data_type} = 'binary'; last; } - } $info->{size} = $col_obj->DefinedSize; @@ -209,6 +191,33 @@ sub _columns_info_for { return $result; } +# Trap and ignore OLE warnings from nonexistant comments tables. + +sub _table_comment { + my $self = shift; + + my $warn_handler = $SIG{__WARN__} || sub { warn @_ }; + + local $SIG{__WARN__} = sub { + $warn_handler->(@_) unless $_[0] =~ /cannot find the input table/; + }; + + $self->next::method(@_); +} + +sub _column_comment { + my $self = shift; + + my $warn_handler = $SIG{__WARN__} || sub { warn @_ }; + + local $SIG{__WARN__} = sub { + $warn_handler->(@_) unless $_[0] =~ /cannot find the input table/; + }; + + $self->next::method(@_); +} + + =head1 SEE ALSO L,