sql query in play-slick, with a function like contains
<p>I‘m new to slick, and a problem is bothering me.
I want to query a table named attach, and find the <code>attach_id</code> that is contained in the array <code>b</code> which is a normal Scala array:</p>

<pre><code>val attaches: TableQuery[AttachTable] = TableQuery[AttachTable]
val b = Array[Int](1,2,3)

// This query works well, but I actually need the attach_id that in the array b 
def query = for {
  a &lt;- attaches if (a.attach_id === 1)
} yield (a.url)

// If I replace it like this, it doesn't work, and I don't know why
def query = for {
  a &lt;- attaches if (b.contains(a.attach_id))
} yield (a.url)

// This also failed, because b is Array[Int]
def query = for {
  a &lt;- attaches if (a.attach_id in b)
} yield (a.url)
</code></pre>

<p>Can anyone help me???</p>