我的问题是:如何创建一个等效于以下SQL的Slick编译查询:
select * from table where word in ('word1', 'word2', 'word3')
Run Code Online (Sandbox Code Playgroud)
我目前坚持使用的代码如下所示:
val findByWords = Compiled { words: Set[String] =>
keywords.filter(_.word inSet words)
}
Run Code Online (Sandbox Code Playgroud)
编译时,我收到以下错误:
Computation of type Set[String] => slick.lifted.Query[com.company.business.db.CensoredKeyWords,com.company.business.db.CensoredKeyWords#TableElementType,Seq] cannot be compiled (as type C) val findByWords = Compiled { words: Set[String] => ^
请注意,箭头指向大括号.
我正在使用Slick 3.2.1.Scala 2.12.3
归档时间: |
|
查看次数: |
240 次 |
最近记录: |