I'm having an issue with Slick 3 getting a proper reference to the Table in an implicit query enhancement. This code works fine in Slick 2 but the new Table only has a Seq[Columns] on which I still can't call the column method on.
class SlickUtils {
implicit class QueryEnrichment[M,U<: Table[U] /*not valid */,C[_]](q: Query[U,M,C]) {
def sortDynamic(sortString: String): Query[U,M,C] = {
val sortKeys = sortString.split(',').toList.map(_.split('.').map(_.toUpperCase).toList)
sortDynamicImpl(sortKeys)
}
private def sortDynamicImpl(sortKeys: List[Seq[String]]): Query[U,M,C] = {
sortKeys match {
case key :: tail =>
sortDynamicImpl(tail).sortBy(table =>
key match {
case name :: Nil => table.column[String](name).desc // DOES NOT HAVE COLUMN METHOD
}
)
}
}
}
}