DBIx::Class::ResultSource::MultipleTableInheritance is a Perl module that allows to use multiple tables to define your classes.
This only works with PostgreSQL at the moment. It has been tested with PostgreSQL 9.0, 9.1 beta, and 9.1.
There is one additional caveat: the "parent" result classes that you defined with this resultsource must have one primary column and it must be named "id."
SYNOPSIS
{
package Cafe::Result::Coffee;
use strict;
use warnings;
use parent 'DBIx::Class::Core';
use aliased 'DBIx::Class::ResultSource::MultipleTableInheritance'
=> 'MTI';
__PACKAGE__->table_class(MTI);
__PACKAGE__->table('coffee');
__PACKAGE__->add_columns(
"id", { data_type => "integer" },
"flavor", {
data_type => "text",
default_value => "good" },
);
__PACKAGE__->set_primary_key("id");
1;
}
{
package Cafe::Result::Sumatra;
use parent 'Cafe::Result::Coffee';
__PACKAGE__->table('sumatra');
__PACKAGE__->add_columns( "aroma",
{ data_type => "text" }
);
1;
}
...
my $schema = Cafe->connect($dsn,$user,$pass);
my $cup = $schema->resultset('Sumatra');
print STDERR Dwarn $cup->result_source->columns;
"id"
"flavor"
"aroma"
..
Product's homepage
Requirements:
· Perl