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

Matt S Trout dbix-class at trout.me.uk
Sun Apr 30 01:21:58 CEST 2006


Dan Horne wrote:
> 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','parameter_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?

perl -MDBIx::Class -e 'print $DBIx::Class::VERSION;'

I suspect you have a really old one.

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Dbix-class mailing list