This is basically the repeat of an earlier question, but with respect to Slick-2, as the answers that worked for v.1 don't work anymore.
In short, Slick documentation suggests to do something like this
package models
import scala.slick.driver.H2Driver.simple._
class Pictures(tag: Tag) extends Table[(Int, String, String)](tag, "Pictures") {
def id = column[Int]("id", O.PrimaryKey)
def urlThumb = column[String]("urlThumb", O.NotNull)
def urlLarge = column[String]("urlLarge", O.NotNull)
def * = (id, urlThumb, urlLarge)
}
This is tying the code directly to H2Driver. I want it to be driver-agnostic, i.e. to work with any JdbcProfile driver. The only way I found to do it is by passing the driver to the DAO class
class SlickDAO(val driver: JdbcProfile) {
import driver.simple._
The problem with that is if I want to define some traits with shared behavior, e.g. CRUDSupport, I can't have arguments to the trait, I can only do an abstract class. So I am curious what is the recommended way of writing the DAL with Slick-2? I'm sure it's the Cake pattern, but I am not advanced enough in Scala to implement it.