[Catalyst] basics of getting started with DBIx

Daniel McBrearty danielmcbrearty at gmail.com
Sat Mar 18 08:09:59 CET 2006


Hi people

Just trying to put together a test script to explore this package, but a bit
stuck with the basics ... I have a class Schema.pm in my library:

package Schema;
use base qw/DBIx::Class::Schema/;
__PACKAGE__->load_classes(qw/ Translator /);
1;

then a subdir Schema containing Translator.pm

package Translator;
use base qw/DBIx::Class/;
__PACKAGE__->table('translators');
__PACKAGE__->add_columns(qw/ name autotx lastcat lang email translations
lastuse /);
__PACKAGE__->set_primary_key('name');
1;

and here's my code ...

use Voc::DB::Schema;
use Voc::Config;
use Data::Dumper;

my $dsn = $Config::cfg->{'sqldb'};
my $u = $Config::cfg->{'sqluser'};
my $p = $Config::cfg->{'sqlpass'};
my $attrs; # what should/can this be?
Voc::DB::Schema->connect($dsn, $u, $p, $attrs);

now when I run I get :

Can't locate object method "result_source_instance" via package
"Schema::Translator" (perhaps you forgot to load "Schema::Translator"?) at
/usr/local/share/perl/5.8.7/DBIx/Class/Schema.pm line 70.

Seems the load isn't working? Why? Is my layout of files and modules
correct?

thanks for the help

Daniel


--
Daniel McBrearty
email : danielmcbrearty at gmail.com
www.engoi.com : the multi - language vocab trainer
BTW : 0873928131
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060318/ee8c2a0a/attachment.htm 


More information about the Catalyst mailing list