playframework / play-slick

Slick Plugin for Play
Apache License 2.0
804 stars 283 forks source link

Unsupported operations post upgrading to scala 2.12 #701

Open rahul-narayana opened 2 years ago

rahul-narayana commented 2 years ago

Hello Team,

I am migrating a legacy play project from scala 2.11 to 2.12. We have a dependency on slick for jdbc connections

The version we are using:

  "com.typesafe.play" %% "play-slick" % "3.0.1",
  "com.typesafe.slick" %% "slick-hikaricp" % "3.2.3",
  "com.typesafe.play" %% "play-slick-evolutions" % "3.0.1",

For unit tests we are using H2 in-memory database. We are injecting the database client. Slick configuration for the same:

slick.dbs.default.profile="slick.jdbc.H2Profile$"
slick.dbs.default.db.driver="org.h2.Driver"
slick.dbs.default.db.url="jdbc:h2:mem:play;MODE=MYSQL;DB_CLOSE_DELAY=-1"
slick.dbs.default.db.user=sa
slick.dbs.default.db.password="sa"
slick.dbs.default.db.numThreads = 4
slick.dbs.default.db.queueSize = 200

Post upgrading to scala 2.12, Few test cases have started failing due to unsupported operation exception

slick.SlickException: InsertOrUpdate is not supported on a table without PK.
  at slick.jdbc.JdbcActionComponent$InsertActionComposerImpl$InsertOrUpdateAction.<init>(JdbcActionComponent.scala:550)
  at slick.jdbc.JdbcActionComponent$InsertActionComposerImpl.insertOrUpdate(JdbcActionComponent.scala:468)

Since I am not changing the version wondering what could have caused this compatibility issue

mkurz commented 2 years ago

So you say the underlying slick versions hasn't changed? You only changed the Scala version?