I am trying to have a generic type definition that can be satisfied by slicks TableQuery type:
class OrderTable(tag: Tag) extends Table[Order](tag, "orders")
...
val orders = TableQuery[OrderTable]
type Ta[X] = TableQuery[Table[X]]
val orderTable: Ta[Order] = orders
What I want to achieve is that I have an abstract type definition in a trait that can be slick table but also something else like just a hashmap. I am getting the following compilation error:
found : slick.jdbc.PostgresProfile.api.TableQuery[at.gepro.dbtemplate.OrderTable]
(which expands to) slick.lifted.TableQuery[at.gepro.dbtemplate.OrderTable]
required: SlickOrderRepository.this.Ta[at.gepro.dbtemplate.Order]
(which expands to) slick.lifted.TableQuery[slick.jdbc.PostgresProfile.Table[at.gepro.dbtemplate.Order]]
I don't understand why this assignment does not work, everything uses the PostgresProfile
api.
tried AbstractTable
but did not work either