diff --git a/build.sbt b/build.sbt index efd079fc7..9b2faa85f 100644 --- a/build.sbt +++ b/build.sbt @@ -172,7 +172,6 @@ lazy val doobie = project.in(file(".")) bench, core, docs, - fixme, example, free, h2, @@ -294,11 +293,6 @@ lazy val log4cats = project libraryDependencies += "org.typelevel" %% "log4cats-core" % log4catsVersion ) -lazy val fixme = project - .in(file("modules/fixme")) - .settings(doobieSettings) - .dependsOn(core) - lazy val example = project .in(file("modules/example")) .enablePlugins(NoPublishPlugin) diff --git a/modules/core/src/main/scala-3/doobie/util/MkReadPlatform.scala b/modules/core/src/main/scala-3/doobie/util/MkReadPlatform.scala index 5501d0086..6eced2967 100644 --- a/modules/core/src/main/scala-3/doobie/util/MkReadPlatform.scala +++ b/modules/core/src/main/scala-3/doobie/util/MkReadPlatform.scala @@ -10,8 +10,8 @@ import doobie.util.shapeless.OrElse trait MkReadPlatform: // Derivation for product types (i.e. case class) - given derived[P <: Product, A]( - using + implicit def derived[P <: Product, A]( + implicit m: Mirror.ProductOf[P], i: A =:= m.MirroredElemTypes, r: Read[A] `OrElse` Derived[MkRead[A]] @@ -21,8 +21,8 @@ trait MkReadPlatform: } // Derivation base case for tuple (1-element) - given productBase[H]( - using H: Read[H] `OrElse` Derived[MkRead[H]] + implicit def productBase[H]( + implicit H: Read[H] `OrElse` Derived[MkRead[H]] ): Derived[MkRead[H *: EmptyTuple]] = { val headInstance = H.fold(identity, _.instance) new Derived( @@ -35,8 +35,8 @@ trait MkReadPlatform: } // Derivation inductive case for tuples - given product[H, T <: Tuple]( - using + implicit def product[H, T <: Tuple]( + implicit H: Read[H] `OrElse` Derived[MkRead[H]], T: Read[T] `OrElse` Derived[MkRead[T]] ): Derived[MkRead[H *: T]] = { diff --git a/modules/core/src/main/scala-3/doobie/util/MkWritePlatform.scala b/modules/core/src/main/scala-3/doobie/util/MkWritePlatform.scala index 81658645b..2a789ece6 100644 --- a/modules/core/src/main/scala-3/doobie/util/MkWritePlatform.scala +++ b/modules/core/src/main/scala-3/doobie/util/MkWritePlatform.scala @@ -10,8 +10,8 @@ import doobie.util.shapeless.OrElse trait MkWritePlatform: // Derivation for product types (i.e. case class) - given derived[P <: Product, A]( - using + implicit def derived[P <: Product, A]( + implicit m: Mirror.ProductOf[P], i: m.MirroredElemTypes =:= A, w: Derived[MkWrite[A]] @@ -22,8 +22,8 @@ trait MkWritePlatform: ) // Derivation base case for tuple (1-element) - given productBase[H]( - using H: Write[H] `OrElse` Derived[MkWrite[H]] + implicit def productBase[H]( + implicit H: Write[H] `OrElse` Derived[MkWrite[H]] ): Derived[MkWrite[H *: EmptyTuple]] = { val headInstance = H.fold(identity, _.instance) new Derived( @@ -35,8 +35,8 @@ trait MkWritePlatform: } // Derivation inductive case for tuples - given product[H, T <: Tuple]( - using + implicit def product[H, T <: Tuple]( + implicit H: Write[H] `OrElse` Derived[MkWrite[H]], T: Write[H] `OrElse` Derived[MkWrite[H]] ): Derived[MkWrite[H *: T]] = { diff --git a/modules/core/src/test/scala-2/doobie/util/GetSuitePlatform.scala b/modules/core/src/test/scala-2/doobie/util/GetSuitePlatform.scala index aba299e2e..a6daa5f06 100644 --- a/modules/core/src/test/scala-2/doobie/util/GetSuitePlatform.scala +++ b/modules/core/src/test/scala-2/doobie/util/GetSuitePlatform.scala @@ -9,7 +9,7 @@ import doobie.testutils.TestClasses.{CCIntString, PlainObj, CCAnyVal} trait GetSuitePlatform { self: munit.FunSuite => test("Get can be auto derived for unary products (AnyVal)") { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* Get[CCAnyVal].void } @@ -19,7 +19,7 @@ trait GetSuitePlatform { self: munit.FunSuite => } test("Get should not be derived for non-unary products") { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* assertContains(compileErrors("Get[CCIntString]"), "implicit value") assertContains(compileErrors("Get[(Int, Int)]"), "implicit value") diff --git a/modules/core/src/test/scala-2/doobie/util/PutSuitePlatform.scala b/modules/core/src/test/scala-2/doobie/util/PutSuitePlatform.scala index 68aaee3bd..a7eda5bed 100644 --- a/modules/core/src/test/scala-2/doobie/util/PutSuitePlatform.scala +++ b/modules/core/src/test/scala-2/doobie/util/PutSuitePlatform.scala @@ -8,7 +8,7 @@ import doobie.testutils.TestClasses.{CCIntString, PlainObj, CCAnyVal} trait PutSuitePlatform { self: munit.FunSuite => test("Put can be auto derived for unary products (AnyVal)") { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* Put[CCAnyVal].void } @@ -18,7 +18,7 @@ trait PutSuitePlatform { self: munit.FunSuite => } test("Put should not be derived for non-unary products") { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* assertContains(compileErrors("Put[CCIntString]"), "implicit value") assertContains(compileErrors("Put[(Int, Int)]"), "implicit value") diff --git a/modules/core/src/test/scala-3/doobie/util/PutSuitePlatform.scala b/modules/core/src/test/scala-3/doobie/util/PutSuitePlatform.scala index 0628f563b..96305ccf2 100644 --- a/modules/core/src/test/scala-3/doobie/util/PutSuitePlatform.scala +++ b/modules/core/src/test/scala-3/doobie/util/PutSuitePlatform.scala @@ -12,7 +12,7 @@ trait PutSuitePlatform { self: munit.FunSuite => test("Put should be derived for unary products (AnyVal)".ignore) {} test("Put should not be derived for non-unary products") { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* import doobie.testutils.TestClasses.{CCIntString, PlainObj} assertContains(compileErrors("Put[CCIntString]"), "No given instance") diff --git a/modules/core/src/test/scala-3/doobie/util/QueryLogSuitePlatform.scala b/modules/core/src/test/scala-3/doobie/util/QueryLogSuitePlatform.scala index 6d515b21f..6943cfcfe 100644 --- a/modules/core/src/test/scala-3/doobie/util/QueryLogSuitePlatform.scala +++ b/modules/core/src/test/scala-3/doobie/util/QueryLogSuitePlatform.scala @@ -7,7 +7,7 @@ package doobie.util import doobie.util.log.{Parameters, Success, ProcessingFailure} trait QueryLogSuitePlatform { self: QueryLogSuite => - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* test("[Query] n-arg success") { val Sql = "select 1 where ? = ?" diff --git a/modules/core/src/test/scala-3/doobie/util/ReadSuitePlatform.scala b/modules/core/src/test/scala-3/doobie/util/ReadSuitePlatform.scala index c9a8f0d40..87dff1ccc 100644 --- a/modules/core/src/test/scala-3/doobie/util/ReadSuitePlatform.scala +++ b/modules/core/src/test/scala-3/doobie/util/ReadSuitePlatform.scala @@ -15,7 +15,7 @@ trait ReadSuitePlatform { self: munit.FunSuite => case class CaseClassWithFieldWithoutGetInstance(a: String, b: NoGetInstanceForThis) test("Read should exist for some fancy types") { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* Read[Woozle].void Read[(Woozle, String)].void @@ -23,7 +23,7 @@ trait ReadSuitePlatform { self: munit.FunSuite => } test("Read should exist for option of some fancy types") { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* Read[Option[Woozle]].void Read[Option[(Woozle, String)]].void diff --git a/modules/core/src/test/scala-3/doobie/util/WriteSuitePlatform.scala b/modules/core/src/test/scala-3/doobie/util/WriteSuitePlatform.scala index 3315c4306..70276e5eb 100644 --- a/modules/core/src/test/scala-3/doobie/util/WriteSuitePlatform.scala +++ b/modules/core/src/test/scala-3/doobie/util/WriteSuitePlatform.scala @@ -15,7 +15,7 @@ trait WriteSuitePlatform { self: munit.FunSuite => case class CaseClassWithFieldWithoutPutInstance(a: String, b: NoPutInstanceForThis) test("Write should exist for some fancy types") { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* Write[Woozle].void Write[(Woozle, String)].void @@ -23,7 +23,7 @@ trait WriteSuitePlatform { self: munit.FunSuite => } test("Write should exist for option of some fancy types") { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* Write[Option[Woozle]].void Write[Option[(Woozle, String)]].void diff --git a/modules/core/src/test/scala/doobie/issue/780.scala b/modules/core/src/test/scala/doobie/issue/780.scala index 887980798..59c5dfc11 100644 --- a/modules/core/src/test/scala/doobie/issue/780.scala +++ b/modules/core/src/test/scala/doobie/issue/780.scala @@ -11,7 +11,7 @@ import scala.annotation.nowarn @nowarn("msg=.*(Foo is never used|(U|u)nused).*") class `780` extends munit.FunSuite { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* test("deriving instances should work correctly for Write from class scope") { class Foo[A: Write, B: Write] { diff --git a/modules/core/src/test/scala/doobie/util/FragmentsSuite.scala b/modules/core/src/test/scala/doobie/util/FragmentsSuite.scala index da3c84c3f..d54d94fb9 100644 --- a/modules/core/src/test/scala/doobie/util/FragmentsSuite.scala +++ b/modules/core/src/test/scala/doobie/util/FragmentsSuite.scala @@ -5,7 +5,7 @@ package doobie.util import cats.data.NonEmptyList -import doobie.implicits.{*, given} +import doobie.implicits.* import cats.effect.IO import doobie.{Transactor, Fragment, Fragments} diff --git a/modules/core/src/test/scala/doobie/util/GetSuite.scala b/modules/core/src/test/scala/doobie/util/GetSuite.scala index 9f417a2ad..fa9b74b2e 100644 --- a/modules/core/src/test/scala/doobie/util/GetSuite.scala +++ b/modules/core/src/test/scala/doobie/util/GetSuite.scala @@ -23,7 +23,7 @@ class GetSuite extends munit.FunSuite with GetSuitePlatform { } test("Get should be auto derived for unary products") { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* Get[X].void Get[Q].void diff --git a/modules/core/src/test/scala/doobie/util/PutSuite.scala b/modules/core/src/test/scala/doobie/util/PutSuite.scala index e77912a63..a8548e211 100644 --- a/modules/core/src/test/scala/doobie/util/PutSuite.scala +++ b/modules/core/src/test/scala/doobie/util/PutSuite.scala @@ -35,7 +35,7 @@ class PutSuite extends munit.FunSuite with PutSuitePlatform { } test("Put should be auto derived for unary products") { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* Put[X].void Put[Q].void diff --git a/modules/core/src/test/scala/doobie/util/ReadSuite.scala b/modules/core/src/test/scala/doobie/util/ReadSuite.scala index da6e11b86..23f323f43 100644 --- a/modules/core/src/test/scala/doobie/util/ReadSuite.scala +++ b/modules/core/src/test/scala/doobie/util/ReadSuite.scala @@ -25,7 +25,7 @@ class ReadSuite extends munit.FunSuite with ReadSuitePlatform { ) test("Read should exist for some fancy types") { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* Read[Int].void Read[(Int, Int)].void @@ -55,7 +55,7 @@ class ReadSuite extends munit.FunSuite with ReadSuitePlatform { } test("Read is still auto derived for tuples when import is present (no ambiguous implicits)") { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* Read[(Int, Int)].void Read[(Int, Int, String)].void Read[(Int, (Int, String))].void @@ -111,7 +111,7 @@ class ReadSuite extends munit.FunSuite with ReadSuitePlatform { } test("Read should exist for option of some fancy types") { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* Read[Option[Int]].void Read[Option[(Int, Int)]].void @@ -123,14 +123,14 @@ class ReadSuite extends munit.FunSuite with ReadSuitePlatform { } test("Read should exist for option of Unit") { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* Read[Option[Unit]].void assertEquals(Read[Option[(Int, Unit)]].length, 1).void } test("Read should select multi-column instance by default") { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* assertEquals(Read[LenStr1].length, 2).void } diff --git a/modules/core/src/test/scala/doobie/util/WriteSuite.scala b/modules/core/src/test/scala/doobie/util/WriteSuite.scala index 1aca8f76b..e8d9f30a1 100644 --- a/modules/core/src/test/scala/doobie/util/WriteSuite.scala +++ b/modules/core/src/test/scala/doobie/util/WriteSuite.scala @@ -23,7 +23,7 @@ class WriteSuite extends munit.FunSuite with WriteSuitePlatform { ) test("Write should exist for some fancy types") { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* Write[Int].void Write[(Int, Int)].void @@ -44,7 +44,7 @@ class WriteSuite extends munit.FunSuite with WriteSuitePlatform { } test("Write is still auto derived for tuples when import is present (no ambiguous implicits) ") { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* Write[(Int, Int)].void Write[(Int, Int, String)].void Write[(Int, (Int, String))].void @@ -121,14 +121,14 @@ class WriteSuite extends munit.FunSuite with WriteSuitePlatform { } test("Write should exist for Unit") { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* Write[Unit].void assertEquals(Write[(Int, Unit)].length, 1) } test("Write should exist for option of some fancy types") { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* Write[Option[Int]].void Write[Option[(Int, Int)]].void @@ -138,14 +138,14 @@ class WriteSuite extends munit.FunSuite with WriteSuitePlatform { } test("Write should exist for option of Unit") { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* Write[Option[Unit]].void assertEquals(Write[Option[(Int, Unit)]].length, 1) } test("Write should select multi-column instance by default") { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* assertEquals(Write[LenStr1].length, 2) } diff --git a/modules/munit/src/test/scala/doobie/munit/CheckerTests.scala b/modules/munit/src/test/scala/doobie/munit/CheckerTests.scala index 874d6172b..296211fac 100644 --- a/modules/munit/src/test/scala/doobie/munit/CheckerTests.scala +++ b/modules/munit/src/test/scala/doobie/munit/CheckerTests.scala @@ -28,7 +28,7 @@ trait CheckerChecks[M[_]] extends FunSuite with Checker[M] { test("fail".fail) { check(sql"select 1".query[String]) } test("trivial case-class") { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* check(sql"select 1".query[CheckerChecks.Foo[cats.Id]]) } @@ -47,7 +47,7 @@ trait CheckerChecks[M[_]] extends FunSuite with Checker[M] { } test("Read should select correct columns for checking when combined with `ap`") { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* val readInt = Read[(Int, Int)] val readIntToInt: Read[Tuple2[Int, Int] => String] = diff --git a/modules/specs2/src/test/scala/doobie/specs2/CheckerTests.scala b/modules/specs2/src/test/scala/doobie/specs2/CheckerTests.scala index 79b84d9c5..afcc26b63 100644 --- a/modules/specs2/src/test/scala/doobie/specs2/CheckerTests.scala +++ b/modules/specs2/src/test/scala/doobie/specs2/CheckerTests.scala @@ -25,7 +25,7 @@ trait CheckerChecks[M[_]] extends Specification with Checker[M] { // Abstract type parameters should be handled correctly { - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* final case class Foo[F[_]](x: Int) check(sql"select 1".query[Foo[Id]]).void diff --git a/modules/weaver/src/test/scala/doobie/weaver/CheckerTests.scala b/modules/weaver/src/test/scala/doobie/weaver/CheckerTests.scala index 67e18a0d1..97a703c4d 100644 --- a/modules/weaver/src/test/scala/doobie/weaver/CheckerTests.scala +++ b/modules/weaver/src/test/scala/doobie/weaver/CheckerTests.scala @@ -35,7 +35,7 @@ object CheckerTests extends IOSuite with IOChecker { final case class Foo[F[_]](x: Int) test("trivial case-class") { implicit transactor => - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* check(sql"select 1".query[Foo[cats.Id]]) } @@ -54,7 +54,7 @@ object CheckerTests extends IOSuite with IOChecker { } test("Read should select correct columns for checking when combined with `ap`") { implicit transactor => - import doobie.generic.auto.{given, *} + import doobie.generic.auto.* val readInt = Read[(Int, Int)] val readIntToInt: Read[Tuple2[Int, Int] => String] =