Is it possible to use IN clause in plain sql Slick?

前端 未结 4 1716
忘掉有多难
忘掉有多难 2021-01-01 14:16

For example, I want to create the following query:

SELECT c.* FROM Coffees c WHERE c.name IN (\'robusta\', \'arabica\')

My attempt failed:<

4条回答
  •  执笔经年
    2021-01-01 14:50

    The type safe "lifted embedding" API supports this as well:

    val ids = List(1,2,3)
    val q = for {
      f <- Foo if f.id inSet ids // ids is not bound
    }
    

    slick.typesafe.com/doc/1.0.1/api/index.html#scala.slick.lifted.ColumnExtensionMethods

提交回复
热议问题