I\'m having trouble understanding the new Slick DBIOAction
API, which does not seem to have a lot of examples in the docs. I am using Slick 3.0.0, and I need to exe
Try it this way :
val compositeAction = (for {
rawTypes <- TableQuery[DBType].result
pair <- DBIO.sequence(rawTypes.groupBy(_.projectId).toSeq.map(group => DBIO.successful(group)))
counts <- DBIO.sequence(pair.head._2.map(aType => sql"""select count(*) from messages where type_id = ${aType.id}""".as[Int]))
} yield (pair.head._1, pair.head._2.zip(counts))).transactionally