Revision history for Perl extension DBIx::Class::Schema::Loader
+ - better _tables_list for MSSQL
- pick up views in SQLite too
- better rel inflection using Lingua::EN::Inflect::Phrase
- cascade_delete and cascade_copy are turned off for has_many/might_have
DBIx::Class::Schema::Loader::DBI::MSSQL - DBIx::Class::Schema::Loader::DBI MSSQL Implementation.
-=head1 SYNOPSIS
+=head1 DESCRIPTION
- package My::Schema;
- use base qw/DBIx::Class::Schema::Loader/;
+Base driver for Microsoft SQL Server, used by
+L<DBIx::Class::Schema::Loader::DBI::Sybase::Microsoft_SQL_Server> for support
+via L<DBD::Sybase> and
+L<DBIx::Class::Schema::Loader::DBI::ODBC::Microsoft_SQL_Server> for support via
+L<DBD::ODBC>.
- __PACKAGE__->loader_options( debug => 1 );
+See L<DBIx::Class::Schema::Loader> and L<DBIx::Class::Schema::Loader::Base> for
+usage information.
- 1;
+=cut
-=head1 DESCRIPTION
+sub _tables_list {
+ my $self = shift;
-See L<DBIx::Class::Schema::Loader::Base>.
+ my $dbh = $self->schema->storage->dbh;
+ my $sth = $dbh->prepare(<<'EOF');
+select t.table_name
+from information_schema.tables t
+where t.table_schema = ?
+EOF
+ $sth->execute($self->db_schema);
-=cut
+ my @tables = map lc $_, map @$_, @{ $sth->fetchall_arrayref };
+
+ return $self->_filter_tables(@tables);
+}
sub _table_pk_info {
my ($self, $table) = @_;
=head1 SEE ALSO
+L<DBIx::Class::Schema::Loader::DBI::Sybase::Microsoft_SQL_Server>,
+L<DBIx::Class::Schema::Loader::DBI::ODBC::Microsoft_SQL_Server>,
L<DBIx::Class::Schema::Loader>, L<DBIx::Class::Schema::Loader::Base>,
L<DBIx::Class::Schema::Loader::DBI>
=head1 NAME
-DBIx::Class::Schema::Loader::DBI::Sybase::Microsoft_SQL_Server - Subclass for
-using MSSQL through DBD::Sybase
+DBIx::Class::Schema::Loader::DBI::Sybase::Microsoft_SQL_Server - Driver for
+using Microsoft SQL Server through DBD::Sybase
=head1 DESCRIPTION
-See L<DBIx::Class::Schema::Loader::Base>.
-
Subclasses L<DBIx::Class::Schema::Loader::DBI::MSSQL>.
-=cut
-
-# Returns an array of table names
-sub _tables_list {
- my $self = shift;
-
- my ($table, $type) = @_ ? @_ : ('%', '%');
-
- my $dbh = $self->schema->storage->dbh;
- my @tables = $dbh->tables(undef, $self->db_schema, $table, $type);
-
- return $self->_filter_tables(@tables);
-}
+See L<DBIx::Class::Schema::Loader> and L<DBIx::Class::Schema::Loader::Base>.
=head1 SEE ALSO
-L<DBIx::Class::Schema::Loader::DBI::Sybase>,
L<DBIx::Class::Schema::Loader::DBI::MSSQL>,
+L<DBIx::Class::Schema::Loader::DBI::ODBC::Microsoft_SQL_Server>,
+L<DBIx::Class::Schema::Loader::DBI::Sybase::Common>,
L<DBIx::Class::Schema::Loader::DBI>
L<DBIx::Class::Schema::Loader>, L<DBIx::Class::Schema::Loader::Base>,
};
ok(!$@, "Loader initialization") or diag $@;
-
+
find sub { return if -d; $file_count++ }, $DUMP_DIR;
$expected_count += grep /CREATE (?:TABLE|VIEW)/i,