I am trying to migrate some code from Slick 2.1 to Slick 3.1 in a Play application and the documentation on DBIO Actions is going completely over my head. And I am having a hard time finding examples anywhere online that show how to migrate uses of StaticQuery to Slick 3.1. Here is the code I had in Slick 2.1:
import scala.slick.jdbc.{GetResult, StaticQuery => Q}
...
object RegionTable {
...
def selectSomething(param1: Double, param2: Double): List[Region] = db.withSession { implicit session =>
val selectSomethingQuery = Q.query[(Double, Double), Region](
"""SELECT ...""".stripMargin
)
selectSomethingQuery((param1, param2)).list
}
}
Link to the full code:
https://github.com/ProjectSidewalk/SidewalkWebpage/blob/master/app/models/region/RegionTable.scala
Similar questions:
How to use StaticQuery in Slick 3.0.0?
How to port Slick 2.1 plain SQL queries to Slick 3.0
Documentation and helpful blog posts
http://slick.lightbend.com/doc/3.0.0/upgrade.html
http://slick.lightbend.com/doc/3.1.1/upgrade.html