9

If I want to use compiled time queries in Slick 3.x, I need to declare a StaticDatabaseConfig annotation in every class using tsql.

Is there any way to avoid this and set a global config?

@StaticDatabaseConfig("file:src/main/resources/application.conf#tsql")
object PersistenceService {
  val database = Database.forConfig("database")
  database.run( tsql"SELECT NOW()" )
}
paneerakbari
  • 680
  • 1
  • 4
  • 17
AlexITC
  • 1,054
  • 1
  • 10
  • 21

0 Answers0