DBIx::Class::Schema - composable schemas
in My/Schema.pm package My::Schema; use base qw/DBIx::Class::Schema/; __PACKAGE__->load_classes(qw/Foo Bar Baz/); in My/Schema/Foo.pm package My::Schema::Foo; use base qw/DBIx::Class::Core/; __PACKAGE__->table('foo'); ... in My/DB.pm use My::Schema; My::Schema->compose_connection('My::DB', $dsn, $user, $pass, $attrs); then in app code my @obj = My::DB::Foo->search({}); # My::DB::Foo isa My::Schema::Foo My::DB
Matt S. Trout <mst@shadowcatsystems.co.uk>
You may distribute this code under the same terms as Perl itself.
To install DBIx::Class, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Class
CPAN shell
perl -MCPAN -e shell install DBIx::Class
For more information on module installation, please visit the detailed CPAN module installation guide.