how can implement in operator in slick 3.2

18 views
Skip to first unread message

techlan...@gmail.com

unread,
Sep 20, 2017, 5:59:52 AM9/20/17
to Slick / ScalaQuery
hi every one ?
how can implement this query in Slick 3.2 (operator in )

SELECT *
FROM  transaction
WHERE  transaction.msg_id = @msgID
AND  transaction.status_id IN (2,3,4,6))


i read this page but not found sample : http://slick.lightbend.com/doc/3.2.1/sql-to-slick.html

Richard Dallaway

unread,
Sep 20, 2017, 4:48:18 PM9/20/17
to Slick / ScalaQuery
Hello 

The operator is called `inSet` in Slick.

Something like:

// Danger: I've not tried to compile this.
transactionTable.filter(t => t.msgId === msgId && t.status inSet Seq(2,3,4,6))

There's a small reference to it on the page you found, in the subquery section (http://slick.lightbend.com/doc/3.2.1/sql-to-slick.html#subquery).  The query example there uses `in` but also mentions`inSet`. In case that's useful as an example.

Hope that helps


--

---
You received this message because you are subscribed to the Google Groups "Slick / ScalaQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalaquery+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalaquery/0ea3aa70-183b-47d2-9322-380515957d79%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages