[Dbix-class] Error : Can't locate object method "connect"

Dan Horne dan.horne at redbone.co.nz
Sun Apr 30 01:06:46 CEST 2006


Hi

I've started experimenting with DBIx::Class, but my initial efforts appear
to be thwarted. The code:

My/Schema.pm:

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


My/Schema/Configuration.pm:

package My::Schema::Configuration;
use base qw/DBIx::Class/;
__PACKAGE__->load_components(qw/PK::Auto Core/);
__PACKAGE__->table('configuration');
__PACKAGE__->add_columns('parameter_id','parameter','value','description','p
arameter_group','sort_order');
__PACKAGE__->set_primary_key('parameter_id');
1;

And my test script, test.pl:

#!/usr/local/bin/perl -w
use strict;
use My::Schema;
my $schema =  My::Schema->connect('dbi:mysql:times_mig','root','');

However, when I run the test, I get:

Can't locate object method "connect" via package "My::Schema" at ./test.pl
line 4.

Can someone tell me what I'm doing wrong?

Thanks

Dan Horne

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/dbix-class/attachments/20060430/5fb1a9a0/attachment.htm 


More information about the Dbix-class mailing list