I have just started using slick and have found myself writing duplicate code for common queries. What techniques have people used to share common queries across Models? For example, in the MyModel object that extends Table[SomeOtherType], I might have something like:
def all : List[SomeOtherType] = DB.withSession { implicit session : Session =>
(for(record <- MyModel) yield record).list
}
so that I can just write MyModel.all
. How can I extend all of my tables with this behavior?