From: Rafael Kitover Date: Mon, 25 May 2009 18:36:19 +0000 (+0000) Subject: cleaned up ODBC crap and added docs X-Git-Tag: 0.04999_08~16^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e57fd7269a26350d11d6162e7aca7812b0938f7a;p=dbsrgits%2FDBIx-Class-Schema-Loader.git cleaned up ODBC crap and added docs --- diff --git a/lib/DBIx/Class/Schema/Loader/DBI.pm b/lib/DBIx/Class/Schema/Loader/DBI.pm index 098b0bf..942438d 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI.pm @@ -75,8 +75,10 @@ sub _rebless { } sub _tables_list { my $self = shift; + my ($table, $type) = @_ ? @_ : ('%', '%'); + my $dbh = $self->schema->storage->dbh; - my @tables = $dbh->tables(undef, $self->db_schema, '%', '%'); + my @tables = $dbh->tables(undef, $self->db_schema, $table, $type); s/\Q$self->{_quoter}\E//g for @tables; s/^.*\Q$self->{_namesep}\E// for @tables; diff --git a/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm b/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm index b4cdec3..4cd29ef 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm @@ -8,11 +8,28 @@ use Class::C3; our $VERSION = '0.04999_06'; +=head1 NAME + +DBIx::Class::Schema::Loader::DBI::ODBC - L proxy, currently only for +Microsoft SQL Server + +=head1 DESCRIPTION + +Reblesses into L, +which is a proxy for L when using the +L driver with Microsoft SQL Server. + +Code stolen from the L ODBC storage. + +See L for usage information. + +=cut + sub _rebless { my $self = shift; my $dbh = $self->schema->storage->dbh; -# stolen from DBIC ODBC driver for MSSQL +# stolen from DBIC ODBC storage my $dbtype = eval { $dbh->get_info(17) }; unless ( $@ ) { # Translate the backend name into a perl identifier @@ -23,4 +40,17 @@ sub _rebless { } } +=head1 SEE ALSO + +L, +L, +L, L, +L + +=head1 AUTHOR + +Rafael Kitover C + +=cut + 1; diff --git a/lib/DBIx/Class/Schema/Loader/DBI/ODBC/Microsoft_SQL_Server.pm b/lib/DBIx/Class/Schema/Loader/DBI/ODBC/Microsoft_SQL_Server.pm index 5b956ab..cbf1ed7 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/ODBC/Microsoft_SQL_Server.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/ODBC/Microsoft_SQL_Server.pm @@ -1,16 +1,42 @@ package DBIx::Class::Schema::Loader::DBI::ODBC::Microsoft_SQL_Server; +use strict; +use warnings; use base 'DBIx::Class::Schema::Loader::DBI::MSSQL'; +use Carp::Clan qw/^DBIx::Class/; +use Class::C3; + +our $VERSION = '0.04999_06'; + +=head1 NAME + +DBIx::Class::Schema::Loader::DBI::ODBC::Microsoft_SQL_Server - ODBC wrapper for +L + +=head1 DESCRIPTION + +Proxy for L when using L. + +See L for usage information. + +=cut sub _tables_list { my $self = shift; - my $dbh = $self->schema->storage->dbh; - my @tables = $dbh->tables(undef, $self->db_schema); - s/\Q$self->{_quoter}\E//g for @tables; - s/^.*\Q$self->{_namesep}\E// for @tables; - - return @tables; + return $self->next::method(undef, undef); } +=head1 SEE ALSO + +L, +L, L, +L + +=head1 AUTHOR + +Rafael Kitover C + +=cut + 1;