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
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
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 => {