Compiled queries in Slick
I need to compile a query in Slick with Play and PostgreSQL
val bioMaterialTypes: TableQuery[Tables.BioMaterialType] = Tables.BioMaterialType def getAllBmts() = for{ bmt <- bioMaterialTypes } yield bmt val queryCompiled = Compiled(getAllBmts _)
but in Scala IDE I am getting this error in Application compiled
Multiple markers at this line - Computation of type () => scala.slick.lifted.Query[models.Tables.BioMaterialType,models.Tables.BioMaterialTypeRow,Seq] cannot be compiled (as type C) - not enough arguments for method apply: (implicit compilable: scala.slick.lifted.Compilable[() => scala.slick.lifted.Query[models.Tables.BioMaterialType,models.Tables.BioMaterialTypeRow,Seq],C], implicit driver: scala.slick.profile.BasicProfile)C in object Compiled. Unspecified value parameters compilable, driver.
This is my import:
import scala.concurrent.Future import scala.slick.jdbc.StaticQuery.staticQueryToInvoker import scala.slick.lifted.Compiled import scala.slick.driver.PostgresDriver import javax.inject.Inject import javax.inject.Singleton import models.BioMaterialType import models.Tables import play.api.Application import play.api.db.slick.Config.driver.simple.TableQuery import play.api.db.slick.Config.driver.simple.columnExtensionMethods import play.api.db.slick.Config.driver.simple.longColumnType import play.api.db.slick.Config.driver.simple.queryToAppliedQueryInvoker import play.api.db.slick.Config.driver.simple.queryToInsertInvoker import play.api.db.slick.Config.driver.simple.stringColumnExtensionMethods import play.api.db.slick.Config.driver.simple.stringColumnType import play.api.db.slick.Config.driver.simple.valueToConstColumn import play.api.db.slick.DB import play.api.db.slick.DBAction
+3
source to share