Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release for newer Slick versions #82

Closed
nafg opened this issue Jul 17, 2023 · 3 comments
Closed

Release for newer Slick versions #82

nafg opened this issue Jul 17, 2023 · 3 comments

Comments

@nafg
Copy link

nafg commented Jul 17, 2023

Slick 3.4.1 was released last September, and last week 3.5.0-M4 was released, which supports Scala 3. That doesn't only mean that it cross-builds for Scala 3 but also that the code generator is updated to produce code that compiles on Scala 3.

As I mentioned in playframework/play-samples#368 (comment) I tried using 3.5.0-M4 with sbt-slick-codegen 2.0.0 and got a NoSuchMethodError at runtime. I don't know whether that's due to bincompat breakage in 3.4.x or 3.5.x. So a stable release for 3.4.1 might help, but a prerelease for 3.5.0-M4 would certainly be appreciated.

@mkurz
Copy link

mkurz commented Feb 21, 2024

@tototoshi Can you please make this plugin compatible with latest slick 3.5.0-RC1 and Scala 3? We get errors in our play-samples application: https://github.com/playframework/play-samples/actions/runs/7995428014/job/21835745092?pr=368

[error] -- Error: /home/runner/work/play-samples/play-samples/play-scala-isolated-slick-example/modules/slick/target/scala-3.3.1/src_managed/main/com/example/user/slick/Tables.scala:4:22 
[error] 4 |object Tables extends {
[error]   |                      ^
[error]   |                      `extends` must be followed by at least one parent
[error] -- [E009] Syntax Error: /home/runner/work/play-samples/play-samples/play-scala-isolated-slick-example/modules/slick/target/scala-3.3.1/src_managed/main/com/example/user/slick/Tables.scala:6:2 
[error] 6 |} with Tables
[error]   |  ^^^^
[error]   |  Early definitions are not supported; use trait parameters instead
[error]   |
[error]   | longer explanation available when compiling with `-explain`
[error] -- Error: /home/runner/work/play-samples/play-samples/play-scala-isolated-slick-example/modules/slick/target/scala-3.3.1/src_managed/main/com/example/user/slick/Tables.scala:6:7 
[error] 6 |} with Tables
[error]   |       ^^^^^^
[error]   |       end of toplevel definition expected but identifier found
[error] -- [E008] Not Found Error: /home/runner/work/play-samples/play-samples/play-scala-isolated-slick-example/modules/slick/target/scala-3.3.1/src_managed/main/com/example/user/slick/Tables.scala:36:27 
[error] 36 |    FlywaySchemaHistoryRow.tupled((<<[Int], <<?[String], <<[String], <<[String], <<[String], <<?[Int], <<[String], <<[java.time.Instant], <<[Int], <<[Boolean]))
[error]    |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error]    |value tupled is not a member of object Tables.this.FlywaySchemaHistoryRow
[error] -- [E008] Not Found Error: /home/runner/work/play-samples/play-samples/play-scala-isolated-slick-example/modules/slick/target/scala-3.3.1/src_managed/main/com/example/user/slick/Tables.scala:41:153 
[error] 41 |    def * = (installedRank, version, description, `type`, script, checksum, installedBy, installedOn, executionTime, success) <> (FlywaySchemaHistoryRow.tupled, FlywaySchemaHistoryRow.unapply)
[error]    |                                                                                                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error]    |value tupled is not a member of object Tables.this.FlywaySchemaHistoryRow
[error] -- [E008] Not Found Error: /home/runner/work/play-samples/play-samples/play-scala-isolated-slick-example/modules/slick/target/scala-3.3.1/src_managed/main/com/example/user/slick/Tables.scala:43:268 
[error] 43 |    def ? = ((Rep.Some(installedRank), version, Rep.Some(description), Rep.Some(`type`), Rep.Some(script), checksum, Rep.Some(installedBy), Rep.Some(installedOn), Rep.Some(executionTime), Rep.Some(success))).shaped.<>({r=>import r._; _1.map(_=> FlywaySchemaHistoryRow.tupled((_1.get, _2, _3.get, _4.get, _5.get, _6, _7.get, _8.get, _9.get, _10.get)))}, (_:Any) =>  throw new Exception("Inserting into ? projection not supported."))
[error]    |                                                                                                                                                                                                                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error]    |value tupled is not a member of object Tables.this.FlywaySchemaHistoryRow
[error] -- [E008] Not Found Error: /home/runner/work/play-samples/play-samples/play-scala-isolated-slick-example/modules/slick/target/scala-3.3.1/src_managed/main/com/example/user/slick/Tables.scala:82:13 
[error] 82 |    UsersRow.tupled((<<[String], <<[String], <<[java.time.Instant], <<?[java.time.Instant]))
[error]    |    ^^^^^^^^^^^^^^^
[error]    |    value tupled is not a member of object Tables.this.UsersRow
[error] -- [E008] Not Found Error: /home/runner/work/play-samples/play-samples/play-scala-isolated-slick-example/modules/slick/target/scala-3.3.1/src_managed/main/com/example/user/slick/Tables.scala:86:59 
[error] 86 |    def * = (id, email, createdAt, updatedAt) <> (UsersRow.tupled, UsersRow.unapply)
[error]    |                                                  ^^^^^^^^^^^^^^^
[error]    |             value tupled is not a member of object Tables.this.UsersRow
[error] -- [E008] Not Found Error: /home/runner/work/play-samples/play-samples/play-scala-isolated-slick-example/modules/slick/target/scala-3.3.1/src_managed/main/com/example/user/slick/Tables.scala:88:124 
[error] 88 |    def ? = ((Rep.Some(id), Rep.Some(email), Rep.Some(createdAt), updatedAt)).shaped.<>({r=>import r._; _1.map(_=> UsersRow.tupled((_1.get, _2.get, _3.get, _4)))}, (_:Any) =>  throw new Exception("Inserting into ? projection not supported."))
[error]    |                                                                                                                   ^^^^^^^^^^^^^^^
[error]    |             value tupled is not a member of object Tables.this.UsersRow
[warn] two warnings found
[error] 9 errors found
[error] (slick / Compile / compileIncremental) Compilation failed

@tototoshi
Copy link
Owner

@mkurz I just published sbt-slick-codegen 2.2.0-RC2 🚀 . Please try it.

@mkurz
Copy link

mkurz commented Feb 25, 2024

@tototoshi Thanks, it's working! I applied it in

I guess it makes sense to wait for the slick 3.5.0 final release to also release sbt-slick-codegen 2.2.0 final. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants