DBIx::Class base result class
- by Rob
Hi there,
I am trying to create a model for Catalyst by using DBIx::Class::Schema::Loader. I want the result classes to have a base class I can add methods to. So MyTable.pm inherits from Base.pm which inherits from DBIx::Class::core (default).
Somehow I cannot figure out how to do this. my create script is below, can anyone tell me what I am doing wrong? The script creates my model ok, but all resultset classes just directly inherit from DBIx::Class::core without my Base class in between.
#!/usr/bin/perl
use DBIx::Class::Schema::Loader qw/ make_schema_at /;
#specifically for the entities many-2-many relation
$ENV{DBIC_OVERWRITE_HELPER_METHODS_OK} = 1;
make_schema_at(
'MyApp::Schema',
{
dump_directory => '/tmp',
debug => 1,
overwrite_modifications => 1,
components => ['EncodedColumn'], #encoded password column
use_namespaces => 1,
default_resultset_class => 'Base'
},
[ 'DBI:mysql:database=mydb;host=localhost;port=3306','rob', '******' ],
);