Reputation: 6152
I have a list with IDs that are selected by the user. What is the best way to search all rows using this list of IDs in DBIx::Class??
Upvotes: 3
Views: 991
Reputation: 240531
Use
$rs->search({
whatever_the_column_is => {
'=' => [ @a_bunch_of_ids ]
}
})
or
$rs->search({
whatever_the_column_is => {
-in => [ @a_bunch_of_ids ]
}
})
if your DB likes IN
queries better. Both are documented in SQL::Abstract docs.
Upvotes: 5