DBIx::Class::Schema::Loader is a Perl module that automates the definition of a DBIx::Class::Schema by scanning database table definitions and setting up the columns, primary keys, and relationships.
DBIx::Class::Schema::Loader currently supports only the DBI storage type. It has explicit support for DBD::Pg, DBD::mysql, DBD::DB2, DBD::SQLite, and DBD::Oracle. Other DBI drivers may function to a greater or lesser degree with this loader, depending on how much of the DBI spec they implement, and how standard their implementation is.
Patches to make other DBDs work correctly welcome.
See DBIx::Class::Schema::Loader::DBI::Writing for notes on writing your own vendor-specific subclass for an unsupported DBD driver.
This module requires DBIx::Class 0.07006 or later, and obsoletes the older DBIx::Class::Loader.
This module is designed more to get you up and running quickly against an existing database, or to be effective for simple situations, rather than to be what you use in the long term for a complex database/project.
That being said, transitioning your code from a Schema generated by this module to one that doesn't use this module should be straightforward and painless, so don't shy away from it just for fears of the transition down the road.
use base qw/DBIx::Class::Schema::Loader/;
constraint => '^foo.*',
# debug => 1,
# in seperate application code ...
my $schema1 = My::Schema->connect( $dsn, $user, $password, $attrs);
my $schema1 = "My::Schema"; $schema1->connection(as above);