Not yet released
- Fix limiting table list to the specified schema for DB2
- Default db_schema to the username for DB2
+ - Allow specifying a custom loader_class in loader_options
0.04999_04 Wed Mar 12, 2008
- Add is_auto_increment detecton for DB2
$args->{dump_directory} ||= $self->dump_to_dir;
# XXX this only works for relative storage_type, like ::DBI ...
- my $impl = "DBIx::Class::Schema::Loader" . $self->storage_type;
+ my $impl = $args->{loader_class}
+ || "DBIx::Class::Schema::Loader" . $self->storage_type;
$impl->require or
croak qq/Could not load storage_type loader "$impl": / .
qq/"$UNIVERSAL::require::ERROR"/;
These constructor options are the base options for
L<DBIx::Class::Schema::Loader/loader_opts>. Available constructor options are:
+=head2 loader_class
+
+Use the specified class as the loader instead of
+C<DBIx::Class::Schema::Loader${storage_type}>. This is mostly useful for
+subclassing existing loaders or in conjunction with
+L<DBIx::Class::Schema::Loader/dump_to_dir>.
+
=head2 skip_relationships
Skip setting up relationships. The default is to attempt the loading
croak "Failed to require $subclass: $@";
}
elsif(!$@) {
- bless $self, "DBIx::Class::Schema::Loader::DBI::${driver}";
+ bless $self, $subclass unless $self->isa($subclass);
}
# Set up the default quoting character and name seperators
--- /dev/null
+use strict;
+use warnings;
+use Test::More;
+use lib qw(t/lib);
+use make_dbictest_db;
+
+{
+ package DBICTest::Schema;
+ use base qw/ DBIx::Class::Schema::Loader /;
+ __PACKAGE__->loader_options( loader_class => 'TestLoaderSubclass' );
+}
+
+plan tests => 2;
+
+my $schema = DBICTest::Schema->connect($make_dbictest_db::dsn);
+isa_ok($schema->storage, 'DBIx::Class::Storage::DBI::SQLite');
+isa_ok($schema->_loader, 'TestLoaderSubclass');
--- /dev/null
+package TestLoaderSubclass;
+
+use strict;
+use warnings;
+use base qw/DBIx::Class::Schema::Loader::DBI::SQLite/;
+
+1;