score:0

Accepted answer

here is info from doc http://slick.typesafe.com/doc/3.0.0/queries.html#sorting-and-filtering

i guess you can find here what you want. the example from doc:

//building criteria using a "dynamic filter" e.g. from a webform. 
val criteriacolombian = option("colombian")
val criteriaespresso = option("espresso")
val criteriaroast:option[string] = none

val q4 = coffees.filter { coffee => 
  list(
      criteriacolombian.map(coffee.name === _),
      criteriaespresso.map(coffee.name === _),
      criteriaroast.map(coffee.name === _) // not a condition as `criteriaroast` evaluates to `none` 
  ).collect({case some(criteria)  => criteria}).reduceleftoption(_ || _).getorelse(true:column[boolean])
}

More Query from same tag