[Catalyst] Getting the id from a resultset

2007-10-04 Thread Adeola Awoyemi
Hi all, I'm using DBIx::Class and trying to get the 'id' back from a create() call but I get nothing. I have something like: # db table also has an 'id' column which # is set to auto_increment. my $m = $c->model('MyAppDB::Foo'); my $res = $m->create({ name=> 'adeol

Re: [Catalyst] Getting the id from a resultset

2007-10-04 Thread Ash Berlin
Adeola Awoyemi wrote: > Hi all, > > I'm using DBIx::Class and trying to get the 'id' back from a create() > call but I get nothing. > > I have something like: > > # db table also has an 'id' column which > # is set to auto_increment. > my $m = $c->model('MyAppDB::Foo'); > my

Re: [Catalyst] Getting the id from a resultset

2007-10-04 Thread Adeola Awoyemi
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 => {