You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It provides its own api and is used like this: import com.github.takezoe.slick.blocking.BlockingPostgresDriver.blockingApi._
I am strugling to combine the slick-pg with blocking-slick. My first naive approach looks like this:
import com.github.takezoe.slick.blocking.BlockingJdbcProfile
import com.github.tminglei.slickpg._
//trait MyPostgresDriver extends ExPostgresProfile with PgDate2Support {
trait MyPostgresDriver extends BlockingJdbcProfile with PgDate2Support {
override val api = new API with DateTimeImplicits {}
}
object MyPostgresDriver extends MyPostgresDriver
import com.github.takezoe.slick.blocking.BlockingJdbcProfile
import com.github.tminglei.slickpg._
trait MyPostgresDriver extends ExPostgresProfile with BlockingJdbcProfile with PgDate2Support {
override val api = new API with DateTimeImplicits {}
}
object MyPostgresDriver extends MyPostgresDriver
and then using it like this: import util.MyPostgresDriver.blockingApi._
"An timestamp " should {
"be persisted correctly" in {
db.withSession { implicit session =>
val projectId = projectRepo.create("A")
val timestamp = OffsetDateTime.now()
val taskId = taskRepo.insert(Task(0, "blue", TaskStatus.ready, projectId, timestamp))
taskRepo.findById(taskId).lastModification mustBe timestamp
}
}
}
is still failing with:
- should be persisted correctly *** FAILED ***
[info] org.postgresql.util.PSQLException: ERROR: column "last_modification" is of type timestamp with time zone but expression is of type character varying
[info] Hint: You will need to rewrite or cast the expression.
[info] Position: 87
I want to use slick-pg with the great https://github.com/gitbucket/blocking-slick
It provides its own api and is used like this: import com.github.takezoe.slick.blocking.BlockingPostgresDriver.blockingApi._
I am strugling to combine the slick-pg with blocking-slick. My first naive approach looks like this:
This fails with
Illegal inheritance, self-type MyPostgresDriver does not conform to PgDate2Support with PostgresProfile
.I created feature branch for this experiment: https://github.com/nemoo/play-slick-synchronous-example/blob/slick-pg/app/util/MyPostgresDriver.scala
Is there a way to use slick-pg with external Profiles, like the one mentioned above?
The text was updated successfully, but these errors were encountered: