I'm trying to run in Slick 3.1 a transaction that contains two updates. The second update is plain SQL using Slick's sqlu
command. This is my attempt:
val table = TableQuery[TableDB]
val update1 = table.filter(f => f.name === name).update(rec)
val update2 = sqlu"UPDATE table2 SET field = 1 WHERE field = 2"
val action = (for {
_ <- update1
_ <- update2 // <-- compilation error here
} yield ()).transactionally
val future = db.run(action.asTry)
// ... rest of the code
Slick complains in update2
line with the following messages
Implicit conversion found: ⇒ augmentString(): scala.collection.immutable.StringOps
type mismatch; found : scala.collection.immutable.IndexedSeq[Unit] required: slick.dbio.DBIOAction[?,?,?]
Is it possible to make this work in a single database transaction?