How to use SQL "LIKE" operator in SLICK

Exactly as you normally would!

val query = for {
  coffee <- Coffees if like "%expresso%"
} yield (, coffee.price)

Will generate SQL like

SELECT name, price FROM coffees WHERE NAME like '%expresso%';

This is how I got it to work:

// argMap is map of type [Str, Str]
val query = for {
    coffee <- coffees if ({ case (k,v) =>
        metric.column[String](k) like s"%${v}%"
      }.reduce(_ && _)
  } yield(

And then you can run this using your db: val res =

Of course res is a future here that you need to use await to get the actual result.