From 21f2c0e90c0b608b8839b45ab271586ab0e26430 Mon Sep 17 00:00:00 2001 From: Jacob Wang Date: Tue, 5 Nov 2024 21:11:52 +0000 Subject: [PATCH] revert changes --- .../core/src/main/scala/doobie/aliases.scala | 28 +++++++++++++------ .../src/test/scala/doobie/issue/706.scala | 5 +--- .../scala/doobie/util/FragmentsSuite.scala | 3 +- .../src/main/scala-2/example/Orm.scala | 14 ++++------ .../src/main/scala/example/FirstExample.scala | 3 +- .../main/scala/example/PostgresPoint.scala | 3 +- .../scala/doobie/h2/circe/H2JsonSuite.scala | 1 - .../h2/src/test/scala/doobie/h2/h2types.scala | 2 +- .../test/scala/doobie/mysql/CheckSuite.scala | 2 +- .../test/scala/doobie/mysql/TypesSuite.scala | 1 - .../scala/doobie/postgres/CheckSuite.scala | 2 -- .../scala/doobie/postgres/TypesSuite.scala | 1 - .../main/scala/doobie/refined/Instances.scala | 2 +- 13 files changed, 33 insertions(+), 34 deletions(-) diff --git a/modules/core/src/main/scala/doobie/aliases.scala b/modules/core/src/main/scala/doobie/aliases.scala index 90239a780..b0c8aa2ce 100644 --- a/modules/core/src/main/scala/doobie/aliases.scala +++ b/modules/core/src/main/scala/doobie/aliases.scala @@ -13,6 +13,18 @@ trait Types { /** @group Type Aliases - Core */ type Meta[A] = doobie.util.meta.Meta[A] + /** @group Type Aliases - Core */ + type Get[A] = doobie.util.Get[A] + + /** @group Type Aliases - Core */ + type Put[A] = doobie.util.Put[A] + + /** @group Type Aliases - Core */ + type Read[A] = doobie.util.Read[A] + + /** @group Type Aliases - Core */ + type Write[A] = doobie.util.Write[A] + /** @group Type Aliases - Core */ type Query[A, B] = doobie.util.query.Query[A, B] @@ -50,17 +62,17 @@ trait Modules { /** @group Module Aliases - Core */ val Meta = doobie.util.meta.Meta - /** @group Type Aliases - Core */ - type Get[A] = doobie.util.Get[A] + /** @group Module Aliases - Core */ + val Get = doobie.util.Get - /** @group Type Aliases - Core */ - type Put[A] = doobie.util.Put[A] + /** @group Module Aliases - Core */ + val Put = doobie.util.Put - /** @group Type Aliases - Core */ - type Read[A] = doobie.util.Read[A] + /** @group Module Aliases - Core */ + val Read = doobie.util.Read - /** @group Type Aliases - Core */ - type Write[A] = doobie.util.Write[A] + /** @group Module Aliases - Core */ + val Write = doobie.util.Write /** @group Module Aliases - Core */ val Query = doobie.util.query.Query diff --git a/modules/core/src/test/scala/doobie/issue/706.scala b/modules/core/src/test/scala/doobie/issue/706.scala index 3c1488c9a..ff74eb7fb 100644 --- a/modules/core/src/test/scala/doobie/issue/706.scala +++ b/modules/core/src/test/scala/doobie/issue/706.scala @@ -7,11 +7,8 @@ package doobie.issue import cats.* import cats.syntax.all.* import cats.effect.IO -import doobie.* -import doobie.implicits.* -import doobie.util.Write +import doobie.*, doobie.implicits.* import org.scalacheck.Prop.forAll - import scala.Predef.* class `706` extends munit.ScalaCheckSuite { diff --git a/modules/core/src/test/scala/doobie/util/FragmentsSuite.scala b/modules/core/src/test/scala/doobie/util/FragmentsSuite.scala index d54d94fb9..68755325c 100644 --- a/modules/core/src/test/scala/doobie/util/FragmentsSuite.scala +++ b/modules/core/src/test/scala/doobie/util/FragmentsSuite.scala @@ -5,9 +5,8 @@ package doobie.util import cats.data.NonEmptyList -import doobie.implicits.* +import doobie.*, doobie.implicits.* import cats.effect.IO -import doobie.{Transactor, Fragment, Fragments} class FragmentsSuite extends munit.FunSuite { import Fragments.* diff --git a/modules/example/src/main/scala-2/example/Orm.scala b/modules/example/src/main/scala-2/example/Orm.scala index c33c7fc26..a7987ac34 100644 --- a/modules/example/src/main/scala-2/example/Orm.scala +++ b/modules/example/src/main/scala-2/example/Orm.scala @@ -5,15 +5,13 @@ package example import cats.Show -import cats.effect.{ExitCode, IO, IOApp} -import cats.syntax.all.* -import doobie.{ConnectionIO, Query, Query0, Transactor, Update} -import doobie.implicits.* -import doobie.util.{Read, Write} +import cats.effect.{IO, IOApp, ExitCode} +import cats.syntax.all._ +import doobie._, doobie.implicits._ import fs2.Stream -import shapeless.* -import shapeless.ops.record.* -import shapeless.ops.hlist.* +import shapeless._ +import shapeless.ops.record._ +import shapeless.ops.hlist._ /** A super-simple ORM for super-simple data types. We assume auto-generated keys, represented externally, and columns * map 1:1 with fields and have the same names. diff --git a/modules/example/src/main/scala/example/FirstExample.scala b/modules/example/src/main/scala/example/FirstExample.scala index 908f158e7..ff19f575f 100644 --- a/modules/example/src/main/scala/example/FirstExample.scala +++ b/modules/example/src/main/scala/example/FirstExample.scala @@ -8,9 +8,8 @@ package example import cats.Show import cats.syntax.all.* import cats.effect.{IO, IOApp} -import doobie.{ConnectionIO, FC, Query0, Transactor, Update, Update0} import fs2.Stream -import doobie.implicits.* +import doobie.*, doobie.implicits.* // Example lifted from slick object FirstExample extends IOApp.Simple { diff --git a/modules/example/src/main/scala/example/PostgresPoint.scala b/modules/example/src/main/scala/example/PostgresPoint.scala index b502333d5..097734794 100644 --- a/modules/example/src/main/scala/example/PostgresPoint.scala +++ b/modules/example/src/main/scala/example/PostgresPoint.scala @@ -5,8 +5,7 @@ package example import cats.effect.{IO, IOApp} -import doobie.{Meta, Transactor} -import doobie.util.Write +import doobie.* import doobie.implicits.* import doobie.postgres.implicits.* import org.postgresql.geometric.PGpoint diff --git a/modules/h2-circe/src/test/scala/doobie/h2/circe/H2JsonSuite.scala b/modules/h2-circe/src/test/scala/doobie/h2/circe/H2JsonSuite.scala index 999c375b4..0c2891a6a 100644 --- a/modules/h2-circe/src/test/scala/doobie/h2/circe/H2JsonSuite.scala +++ b/modules/h2-circe/src/test/scala/doobie/h2/circe/H2JsonSuite.scala @@ -7,7 +7,6 @@ package doobie.h2.circe import cats.effect.IO import doobie.* import doobie.implicits.* -import doobie.util.{Get, Put, Read, Write} import io.circe.{Decoder, Encoder, Json} class H2JsonSuite extends munit.FunSuite { diff --git a/modules/h2/src/test/scala/doobie/h2/h2types.scala b/modules/h2/src/test/scala/doobie/h2/h2types.scala index edf1ea077..91f881a17 100644 --- a/modules/h2/src/test/scala/doobie/h2/h2types.scala +++ b/modules/h2/src/test/scala/doobie/h2/h2types.scala @@ -5,11 +5,11 @@ package doobie.h2 import java.util.UUID + import cats.effect.IO import doobie.* import doobie.implicits.* import doobie.h2.implicits.* -import doobie.util.{Put, Get, Read} import doobie.util.analysis.{Analysis, ColumnTypeError} import doobie.util.arbitraries.SQLArbitraries.* import doobie.util.arbitraries.StringArbitraries.* diff --git a/modules/mysql/src/test/scala/doobie/mysql/CheckSuite.scala b/modules/mysql/src/test/scala/doobie/mysql/CheckSuite.scala index bd6692c8f..b1c15af4a 100644 --- a/modules/mysql/src/test/scala/doobie/mysql/CheckSuite.scala +++ b/modules/mysql/src/test/scala/doobie/mysql/CheckSuite.scala @@ -5,10 +5,10 @@ package doobie.mysql import java.time.{LocalDate, LocalDateTime, LocalTime, OffsetDateTime} + import doobie.* import doobie.implicits.* import doobie.mysql.implicits.* -import doobie.util.Read import doobie.util.analysis.ColumnTypeError class CheckSuite extends munit.FunSuite { diff --git a/modules/mysql/src/test/scala/doobie/mysql/TypesSuite.scala b/modules/mysql/src/test/scala/doobie/mysql/TypesSuite.scala index 03165be74..64eb4a800 100644 --- a/modules/mysql/src/test/scala/doobie/mysql/TypesSuite.scala +++ b/modules/mysql/src/test/scala/doobie/mysql/TypesSuite.scala @@ -7,7 +7,6 @@ package doobie.mysql import java.time.ZoneOffset import doobie.* -import doobie.util.{Put, Get} import doobie.implicits.* import doobie.mysql.implicits.* import doobie.mysql.util.arbitraries.SQLArbitraries.* diff --git a/modules/postgres/src/test/scala/doobie/postgres/CheckSuite.scala b/modules/postgres/src/test/scala/doobie/postgres/CheckSuite.scala index 08594b85c..925afe82a 100644 --- a/modules/postgres/src/test/scala/doobie/postgres/CheckSuite.scala +++ b/modules/postgres/src/test/scala/doobie/postgres/CheckSuite.scala @@ -8,9 +8,7 @@ import doobie.* import doobie.implicits.* import doobie.postgres.implicits.* import doobie.postgres.enums.* -import doobie.util.{Put, Read} import doobie.util.analysis.{ColumnTypeError, ParameterTypeError} - import java.time.{Instant, LocalDate, LocalDateTime, LocalTime, OffsetDateTime, OffsetTime} class CheckSuite extends munit.FunSuite { diff --git a/modules/postgres/src/test/scala/doobie/postgres/TypesSuite.scala b/modules/postgres/src/test/scala/doobie/postgres/TypesSuite.scala index 84da2193c..0ca6e7d8e 100644 --- a/modules/postgres/src/test/scala/doobie/postgres/TypesSuite.scala +++ b/modules/postgres/src/test/scala/doobie/postgres/TypesSuite.scala @@ -9,7 +9,6 @@ import java.net.InetAddress import java.time.{LocalDate, LocalDateTime, OffsetDateTime, ZoneOffset} import java.util.UUID import doobie.* -import doobie.util.{Put, Get} import doobie.implicits.* import doobie.postgres.enums.* import doobie.postgres.implicits.* diff --git a/modules/refined/src/main/scala/doobie/refined/Instances.scala b/modules/refined/src/main/scala/doobie/refined/Instances.scala index ca6d1c01a..7b2219a95 100644 --- a/modules/refined/src/main/scala/doobie/refined/Instances.scala +++ b/modules/refined/src/main/scala/doobie/refined/Instances.scala @@ -5,8 +5,8 @@ package doobie package refined -import doobie.util.{Read, Write} import org.tpolecat.typename.* + import doobie.util.invariant.* import eu.timepit.refined.api.{RefType, Validate}