zio-sql icon indicating copy to clipboard operation
zio-sql copied to clipboard

Fix Dotty compilation errors

Open jczuchnowski opened this issue 5 years ago • 4 comments
trafficstars

There are several compilation errors while using Dotty. Once they're fixed we'll be able to include Scala 3 check in build and Scala 3 release. To compile with Dotty run:

sbt "++ 0.27.0-RC1" compile

jczuchnowski avatar Nov 13 '20 19:11 jczuchnowski

I made an attempt at this, but it probably requires a lot more knowledge about the inner workings of both dotty and zio-sql to make everything works. Basically the library code compiles, but I had to refactor the Schema, and I was not able to make Examples.scala compile:

https://github.com/zio/zio-sql/pull/291

scalavision avatar Nov 21 '20 17:11 scalavision

Are there any updates on this? Seems like pretty useful

kirillsalykin avatar Oct 14 '22 14:10 kirillsalykin

Hi, I was following along with the readme, in a gradle project using scala3, and was hit with

Scala 2 macro cannot be used in Dotty. when doing implicit val productSchema = DeriveSchema.gen[Product]

But, the readme intro says:

No magic. ZIO SQL does not need any macros or plug-ins to operate (everything is a value!), and it works across both Scala 2.x and Scala 3. Optionally, Scala schema can be created from database schemas.

So I'm not sure if I'm missing something, or things aren't quite yet running against scala3?

softwareCobbler avatar Apr 29 '23 20:04 softwareCobbler

hello @softwareCobbler . Over time we introduced some macros to ZIO SQL mostly because we wanted to get much better error messages from the compiler. However that made scala 3 release much more complicated as macros need to be rewritten completely. This work is still in progress. I will also change readme to be more up to date. Thanks for pointing this out.

sviezypan avatar May 01 '23 09:05 sviezypan