in reply to Re: dbix::class find() question
in thread dbix::class find() question

is that statement equivalent to this?
$rs = $schema->resultset('records') ->search({ id => { in => \@ids } }) ;

The syntax in your example is a definite improvement!

Replies are listed 'Best First'.
Re^3: dbix::class find() question
by Mr. Muskrat (Canon) on Jan 18, 2016 at 20:42 UTC

    Sort of. The queries are different but what they return should be the same.

    # based on the usual DBIC example tables my @ids = (1..4); my $rs = $schema->resultset('Cd') ->search({ cd_id => \@ids }); warn "query: ", ${$rs->as_query()}->[0], "\n"; $rs = $schema->resultset('Cd') ->search({ cd_id => { in => \@ids } }); warn "query: ", ${$rs->as_query()}->[0], "\n"; __END__ query: (SELECT me.cdid, me.artistid, me.title, me.year FROM cd me WHER +E ( ( cd_id = ? OR cd_id = ? OR cd_id = ? OR cd_id = ? ) )) query: (SELECT me.cdid, me.artistid, me.title, me.year FROM cd me WHER +E ( cd_id IN ( ?, ?, ?, ? ) ))

      Very nice++.

Re^3: dbix::class find() question
by Your Mother (Archbishop) on Jan 18, 2016 at 20:29 UTC

    Yeppers (but see my syntax update). :P