[Catalyst] Getting the id from a resultset

Adeola Awoyemi adeola at digitalcraftsmen.net
Thu Oct 4 11:04:30 GMT 2007


Ash Berlin wrote:
> Have you set_primary_key on that result source? Does the id column have
> an is_auto_increment attribute?

This seemed to do the trick. I had set these fields in the database but 
failed to do the same when creating the Model. So, i did:

     __PACKAGE__->add_columns(id => {
             is_auto_increment => 1,
     });
     __PACKAGE__->add_columns(qw/name message/);

     __PACKAGE__->set_primary_key('id');

And everything worked again.

> (Also s/resultset/row/; and there is a dbix-class mailing list where
> this would be better sent:
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class )

I'll keep this in mind for next time.

Thanks for you help Ash.

Adeola.



More information about the Catalyst mailing list