poj is right already but I offer the other path–
my $rs = $schema->resultset('records'); my @records = $rs->search({ id => \@ids });
The only caveat I might offer here is that search won’t explicitly complain or fail if say only one of the ids is found. I would also suggest that you do this kind of thing instead–
my $rs = $schema->resultset('records') ->search({ id => \@ids }); for my $row ( $rs->all ) {}
As long as you remain in the realm of pure resultsets you don’t execute SQL. So working with them that way—RS until you are ready for records—is more flexible, extensible, and often more performant—as the biz-devs say—since you can end up hitting the DB less.
Update! Didn’t use hasref args initially.
In reply to Re: dbix::class find() question
by Your Mother
in thread dbix::class find() question
by tqisjim
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |