Slick 3.1 inSetBind doesn't return any record

102 views
Skip to first unread message

Victor Para

unread,
Nov 26, 2015, 6:15:44 PM11/26/15
to Slick / ScalaQuery

I'm trying to filter out results inside a slick 3.1.0 query in scala using a function like this:

  def filterByName(names: List[String]) = {
    val q = tableGames.filter(c => c.name inSetBind (names))
    println("FILTERBYNAME: " + q.result.statements.head)
    db.run(q.result)
  }

However, the results always end up empty. If I remove the filtering part it correctly returns all elements in the database. I've created a gist that runs an example end to end right here: Github gist.

Is it a bug or what am I doing wrong?

virtualeyes

unread,
Nov 27, 2015, 9:21:27 AM11/27/15
to Slick / ScalaQuery
looks like you mixed up names and kinds.

val q = tableGames.filter(c => c.kind inSetBind (names))

should work.

Victor Para

unread,
Nov 27, 2015, 10:06:22 AM11/27/15
to Slick / ScalaQuery
Indeed, i messed up the order of arguments at the case class , object definition.
Awesome. Many thanks! 
Reply all
Reply to author
Forward
0 new messages