In slick table there is a tag parameter:
class Companies(tag: Tag) extends Table[Company](tag,"COMPANY") {...}
What is it used for, and is there any way not to write it with each table class definition?
In slick table there is a tag parameter:
class Companies(tag: Tag) extends Table[Company](tag,"COMPANY") {...}
What is it used for, and is there any way not to write it with each table class definition?
The best answer I've seen is: https://stackoverflow.com/a/27783730/154248
What's it used for: imagine you needed to join a table on itself. That tag is a way to distinguish between the tables taking part in a query.
The Tag
provides the AbstractTable
definition of the type, and is passed by Slicks internals.