[Catalyst] Problems using DBIx with update_or_create()

Matt S Trout dbix-class at trout.me.uk
Fri Feb 24 20:01:07 CET 2006


On Fri, Feb 24, 2006 at 10:22:11AM -0700, Nathan Kurz wrote:
> Apologies if this is off topic, but I'm not sure how DBIx and Catalyst
> interrelate.  But I'm having a small problem using Catalyst and the
> DBIx method update_or_create().  My code looks like this:
> 
>     my $user = Notate::Model::DB::User->update_or_create({
>        email => $email,
>        password => md5_hex($password),
>     });
> 
> When I run it, I get an exception that the object method
> 'update_or_create' could not be found.  When I use 'create()',
> everything works as expected.  I think this is just a small problem
> with ResultSetProxy.pm missing some functions.  Or am I doing
> something fundamentally wrong?

No, that's almost certainly the case. ResultSetProxy is designed to support
old usage until people convert over to the Schema approach. If you're still
using DB.pm you should be able to get at the schema object my calling

One::Of::My::Classes->schema_instance

Catalyst and DBIx::Class share a number of the same core developers but are
separate projects (hence DBIx::Class being in the bast repo rather than the
Catalyst one) - there's also a #dbix-class on irc.perl.org and a dbix-class
mailing list (both mentioned in the POD ...).

-- 
     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 Catalyst mailing list