diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d0ed7c2e..3df9b556a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: fail-fast: false matrix: java: ['openjdk@1.11.0', 'openjdk@1.17.0'] - scala: ['2.12.19', '2.13.10'] + scala: ['2.12.19', '2.13.13'] steps: - name: Checkout current branch uses: actions/checkout@v2.3.4 diff --git a/.scalafmt.conf b/.scalafmt.conf index d49630712..858d639ff 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = "3.7.17" +version = "3.8.1" maxColumn = 120 align.preset = most continuationIndent.defnSite = 2 diff --git a/build.sbt b/build.sbt index fb32fb8f9..ebd7b7814 100644 --- a/build.sbt +++ b/build.sbt @@ -23,11 +23,11 @@ addCommandAlias("fmtOnce", "all scalafmtSbt scalafmt test:scalafmt") addCommandAlias("fmt", "fmtOnce;fmtOnce") addCommandAlias("check", "all scalafmtSbtCheck scalafmtCheck test:scalafmtCheck") -val zioVersion = "2.0.21" -val zioSchemaVersion = "0.4.17" +val zioVersion = "2.0.22" +val zioSchemaVersion = "1.1.1" val testcontainersVersion = "1.18.3" val testcontainersScalaVersion = "0.41.3" -val logbackVersion = "1.4.8" +val logbackVersion = "1.5.6" lazy val root = project .in(file(".")) @@ -155,7 +155,7 @@ lazy val jdbc = project libraryDependencies ++= Seq( "dev.zio" %% "zio-test" % zioVersion % Test, "dev.zio" %% "zio-test-sbt" % zioVersion % Test, - "org.postgresql" % "postgresql" % "42.7.2" % Test, + "org.postgresql" % "postgresql" % "42.7.3" % Test, "com.dimafeng" %% "testcontainers-scala-postgresql" % testcontainersScalaVersion % Test ) ) @@ -179,7 +179,7 @@ lazy val jdbc_hikaricp = project "dev.zio" %% "zio-test" % zioVersion % Test, "dev.zio" %% "zio-test-sbt" % zioVersion % Test, "org.testcontainers" % "mysql" % testcontainersVersion % Test, - "mysql" % "mysql-connector-java" % "8.0.29" % Test, + "com.mysql" % "mysql-connector-j" % "8.3.0" % Test, "com.dimafeng" %% "testcontainers-scala-mysql" % testcontainersScalaVersion % Test ) ) @@ -198,7 +198,7 @@ lazy val mysql = project "org.testcontainers" % "database-commons" % testcontainersVersion % Test, "org.testcontainers" % "jdbc" % testcontainersVersion % Test, "org.testcontainers" % "mysql" % testcontainersVersion % Test, - "mysql" % "mysql-connector-java" % "8.0.33" % Test, + "com.mysql" % "mysql-connector-j" % "8.3.0" % Test, "com.dimafeng" %% "testcontainers-scala-mysql" % testcontainersScalaVersion % Test, "ch.qos.logback" % "logback-classic" % logbackVersion % Test ) @@ -217,7 +217,7 @@ lazy val oracle = project "org.testcontainers" % "database-commons" % testcontainersVersion % Test, "org.testcontainers" % "oracle-xe" % testcontainersVersion % Test, "org.testcontainers" % "jdbc" % testcontainersVersion % Test, - "com.oracle.database.jdbc" % "ojdbc8" % "23.2.0.0" % Test, + "com.oracle.database.jdbc" % "ojdbc8" % "23.3.0.23.09" % Test, "com.dimafeng" %% "testcontainers-scala-oracle-xe" % testcontainersScalaVersion % Test, "ch.qos.logback" % "logback-classic" % logbackVersion % Test ) @@ -236,7 +236,7 @@ lazy val postgres = project "org.testcontainers" % "database-commons" % testcontainersVersion % Test, "org.testcontainers" % "postgresql" % testcontainersVersion % Test, "org.testcontainers" % "jdbc" % testcontainersVersion % Test, - "org.postgresql" % "postgresql" % "42.7.2" % Compile, + "org.postgresql" % "postgresql" % "42.7.3" % Compile, "com.dimafeng" %% "testcontainers-scala-postgresql" % testcontainersScalaVersion % Test, "ch.qos.logback" % "logback-classic" % logbackVersion % Test ) diff --git a/core/jvm/src/main/scala/zio/sql/expr/Set.scala b/core/jvm/src/main/scala-2.12/zio/sql/expr/Set.scala similarity index 92% rename from core/jvm/src/main/scala/zio/sql/expr/Set.scala rename to core/jvm/src/main/scala-2.12/zio/sql/expr/Set.scala index cee01b5d9..e5a31f678 100644 --- a/core/jvm/src/main/scala/zio/sql/expr/Set.scala +++ b/core/jvm/src/main/scala-2.12/zio/sql/expr/Set.scala @@ -2,7 +2,6 @@ package zio.sql.expr import zio.sql.typetag.TypeTag import zio.sql.Features -import com.github.ghik.silencer.silent sealed trait Set[F, -A] { type Value @@ -17,7 +16,6 @@ sealed trait Set[F, -A] { object Set { type Aux[F, -A, Value0] = Set[F, A] { type Value = Value0 } - @silent def apply[F: Features.IsSource, A, Value0: TypeTag]( lhs0: Expr[F, A, Value0], rhs0: Expr[_, A, Value0] diff --git a/core/jvm/src/main/scala-2.13/zio/sql/expr/Set.scala b/core/jvm/src/main/scala-2.13/zio/sql/expr/Set.scala new file mode 100644 index 000000000..5b00f655d --- /dev/null +++ b/core/jvm/src/main/scala-2.13/zio/sql/expr/Set.scala @@ -0,0 +1,34 @@ +package zio.sql.expr + +import zio.sql.typetag.TypeTag +import zio.sql.Features + +import scala.annotation.nowarn + +sealed trait Set[F, -A] { + type Value + + def lhs: Expr[F, A, Value] + def rhs: Expr[_, A, Value] + + def typeTag: TypeTag[Value] + +} + +object Set { + type Aux[F, -A, Value0] = Set[F, A] { type Value = Value0 } + + @nowarn + def apply[F: Features.IsSource, A, Value0: TypeTag]( + lhs0: Expr[F, A, Value0], + rhs0: Expr[_, A, Value0] + ): Set.Aux[F, A, Value0] = + new Set[F, A] { + type Value = Value0 + + def lhs = lhs0 + def rhs = rhs0 + + def typeTag = implicitly[TypeTag[Value]] + } +} diff --git a/core/jvm/src/main/scala/zio/sql/select/Read.scala b/core/jvm/src/main/scala/zio/sql/select/Read.scala index b889d9d96..bc485927f 100644 --- a/core/jvm/src/main/scala/zio/sql/select/Read.scala +++ b/core/jvm/src/main/scala/zio/sql/select/Read.scala @@ -39,10 +39,10 @@ sealed trait Read[+Out] { self => } def union[Out1 >: Out](that: Read.Aux[ResultType, Out1]): Read.Aux[ResultType, Out1] = - Read.Union[ResultType, Out1](self, that, true) + Read.Union[ResultType, Out1](self, that, distinct = true) def unionAll[Out1 >: Out](that: Read.Aux[ResultType, Out1]): Read.Aux[ResultType, Out1] = - Read.Union[ResultType, Out1](self, that, false) + Read.Union[ResultType, Out1](self, that, distinct = false) } object Read { diff --git a/core/jvm/src/test/scala/zio/sql/ProductSchema.scala b/core/jvm/src/test/scala/zio/sql/ProductSchema.scala index 2c93fb539..3adc83ebc 100644 --- a/core/jvm/src/test/scala/zio/sql/ProductSchema.scala +++ b/core/jvm/src/test/scala/zio/sql/ProductSchema.scala @@ -30,10 +30,11 @@ object ProductSchema { deleted: Boolean ) - implicit val localDateSchema = + implicit val localDateSchema: Schema[LocalDate] = Schema.primitive[LocalDate](StandardType.LocalDateType) - implicit val productsSchema = DeriveSchema.gen[Product] + implicit val productsSchema: Schema.CaseClass6[String, LocalDate, String, Int, Int, Boolean, Product] = + DeriveSchema.gen[Product] val productTable = Table.defineTable[Product] diff --git a/core/jvm/src/test/scala/zio/sql/TestBasicSelectSpec.scala b/core/jvm/src/test/scala/zio/sql/TestBasicSelectSpec.scala index 6a1846c6b..ac32294d0 100644 --- a/core/jvm/src/test/scala/zio/sql/TestBasicSelectSpec.scala +++ b/core/jvm/src/test/scala/zio/sql/TestBasicSelectSpec.scala @@ -4,7 +4,7 @@ import zio.test._ import zio.test.Assertion._ import zio.schema._ import zio.test.ZIOSpecDefault -import zio.schema.DeriveSchema +import zio.schema.{ DeriveSchema, Schema } import java.time.LocalDate import zio.sql.table._ import zio.sql.select._ @@ -21,9 +21,9 @@ object TestBasicSelect { case class Users(user_id: String, dob: LocalDate, first_name: String, last_name: String) - implicit val localDateSchema = + implicit val localDateSchema: Schema[LocalDate] = Schema.primitive[LocalDate](StandardType.LocalDateType) - implicit val userSchema = DeriveSchema.gen[Users] + implicit val userSchema: Schema.CaseClass4[String, LocalDate, String, String, Users] = DeriveSchema.gen[Users] val userTable = Table.defineTable[Users] diff --git a/examples/src/main/scala/zio/sql/Examples.scala b/examples/src/main/scala/zio/sql/Examples.scala index 293351121..1e056a109 100644 --- a/examples/src/main/scala/zio/sql/Examples.scala +++ b/examples/src/main/scala/zio/sql/Examples.scala @@ -3,7 +3,7 @@ package zio.sql import java.util.UUID import java.time._ import zio.sql.postgresql.PostgresJdbcModule -import zio.schema.DeriveSchema +import zio.schema.{ DeriveSchema, Schema } import zio.sql.expr.AggregationDef._ import zio.sql.expr.FunctionDef._ import zio.sql.table._ @@ -142,7 +142,7 @@ object Examples extends App with PostgresJdbcModule { firstName: String, lastName: String ) - implicit val userSchema = DeriveSchema.gen[User] + implicit val userSchema: Schema.CaseClass5[UUID, Int, LocalDate, String, String, User] = DeriveSchema.gen[User] val dataSchema: User = User(UUID.randomUUID(), 22, LocalDate.ofYearDay(1990, 1), "Ronald", "Russel") @@ -173,7 +173,7 @@ object Examples extends App with PostgresJdbcModule { case class Users(id: UUID, age: Int, dob: LocalDate, firstName: String, lastName: String) - implicit val userSchema = DeriveSchema.gen[Users] + implicit val userSchema: Schema.CaseClass5[UUID, Int, LocalDate, String, String, Users] = DeriveSchema.gen[Users] val users = Table.defineTable[Users] @@ -184,7 +184,7 @@ object Examples extends App with PostgresJdbcModule { case class Orders(id: java.util.UUID, userId: java.util.UUID, orderDate: LocalDate) - implicit val orderSchema = DeriveSchema.gen[Orders] + implicit val orderSchema: Schema.CaseClass3[UUID, UUID, LocalDate, Orders] = DeriveSchema.gen[Orders] val orders = Table.defineTable[Orders] @@ -194,7 +194,8 @@ object Examples extends App with PostgresJdbcModule { object OrderDetails { case class OrderDetail(orderId: java.util.UUID, productId: Int, quantity: Double, unitPrice: Double) - implicit val orderDetailSchema = DeriveSchema.gen[OrderDetail] + implicit val orderDetailSchema: Schema.CaseClass4[java.util.UUID, Int, Double, Double, OrderDetail] = + DeriveSchema.gen[OrderDetail] val orderDetails = Table.defineTable[OrderDetail] diff --git a/examples/src/main/scala/zio/sql/GroupByExamples.scala b/examples/src/main/scala/zio/sql/GroupByExamples.scala index e29738640..505619bd9 100644 --- a/examples/src/main/scala/zio/sql/GroupByExamples.scala +++ b/examples/src/main/scala/zio/sql/GroupByExamples.scala @@ -1,6 +1,6 @@ package zio.sql -import zio.schema.DeriveSchema +import zio.schema.{ DeriveSchema, Schema } import zio.sql.postgresql.PostgresJdbcModule import zio.sql.expr.AggregationDef._ import zio.sql.table._ @@ -9,7 +9,7 @@ object GroupByExamples extends App with PostgresJdbcModule { case class Product(id: Int, name: String, amount: Int, price: Double) - implicit val productSchema = DeriveSchema.gen[Product] + implicit val productSchema: Schema.CaseClass4[Int, String, Int, Double, Product] = DeriveSchema.gen[Product] val productTable = Table.defineTable[Product] diff --git a/examples/src/main/scala/zio/sql/LiveExample.scala b/examples/src/main/scala/zio/sql/LiveExample.scala index 4162a4aba..bb3f65592 100644 --- a/examples/src/main/scala/zio/sql/LiveExample.scala +++ b/examples/src/main/scala/zio/sql/LiveExample.scala @@ -5,7 +5,7 @@ import java.time.LocalDate import java.util.Properties import zio._ -import zio.schema.DeriveSchema +import zio.schema.{ DeriveSchema, Schema } import zio.sql.{ ConnectionPool, ConnectionPoolConfig } import zio.sql.postgresql.PostgresJdbcModule import zio.sql.table._ @@ -71,7 +71,8 @@ object LiveExample extends ZIOAppDefault with PostgresJdbcModule { case class Customer(id: UUID, age: Int, dob: LocalDate, firstName: String, lastName: String) - implicit val customerSchema = DeriveSchema.gen[Customer] + implicit val customerSchema: Schema.CaseClass5[UUID, Int, LocalDate, String, String, Customer] = + DeriveSchema.gen[Customer] val customers = Table.defineTable[Customer]("customers") diff --git a/jdbc/src/main/scala/zio/sql/JdbcInternalModule.scala b/jdbc/src/main/scala/zio/sql/JdbcInternalModule.scala index c07d1ab37..b0590de5a 100644 --- a/jdbc/src/main/scala/zio/sql/JdbcInternalModule.scala +++ b/jdbc/src/main/scala/zio/sql/JdbcInternalModule.scala @@ -106,7 +106,7 @@ trait JdbcInternalModule { self: Jdbc => case TDialectSpecific(t) => t.decode(columnIndex, resultSet) case t @ Nullable() => val _ = nonNull - extractColumn(columnIndex, resultSet, t.typeTag, false).map(Option(_)) + extractColumn(columnIndex, resultSet, t.typeTag, nonNull = false).map(Option(_)) case TNone => Right(None) } } diff --git a/mysql/src/test/scala/zio/sql/mysql/CommonFunctionDefSpec.scala b/mysql/src/test/scala/zio/sql/mysql/CommonFunctionDefSpec.scala index 953588441..bfe405870 100644 --- a/mysql/src/test/scala/zio/sql/mysql/CommonFunctionDefSpec.scala +++ b/mysql/src/test/scala/zio/sql/mysql/CommonFunctionDefSpec.scala @@ -15,7 +15,8 @@ object CommonFunctionDefSpec extends MysqlRunnableSpec with Jdbc { case class Customers(id: UUID, dob: LocalDate, first_name: String, last_name: String, verified: Boolean) - implicit val customerSchema = DeriveSchema.gen[Customers] + implicit val customerSchema: Schema.CaseClass5[UUID, LocalDate, String, String, Boolean, Customers] = + DeriveSchema.gen[Customers] val customers = Table.defineTable[Customers] diff --git a/mysql/src/test/scala/zio/sql/mysql/CustomFunctionDefSpec.scala b/mysql/src/test/scala/zio/sql/mysql/CustomFunctionDefSpec.scala index 34f512f73..8347e7b9e 100644 --- a/mysql/src/test/scala/zio/sql/mysql/CustomFunctionDefSpec.scala +++ b/mysql/src/test/scala/zio/sql/mysql/CustomFunctionDefSpec.scala @@ -15,7 +15,8 @@ object CustomFunctionDefSpec extends MysqlRunnableSpec with Jdbc { case class Customers(id: UUID, dob: LocalDate, first_name: String, last_name: String, verified: Boolean) - implicit val customerSchema = DeriveSchema.gen[Customers] + implicit val customerSchema: Schema.CaseClass5[UUID, LocalDate, String, String, Boolean, Customers] = + DeriveSchema.gen[Customers] val customers = Table.defineTable[Customers] diff --git a/mysql/src/test/scala/zio/sql/mysql/DeleteSpec.scala b/mysql/src/test/scala/zio/sql/mysql/DeleteSpec.scala index 057a3f7e8..fbbc3f71a 100644 --- a/mysql/src/test/scala/zio/sql/mysql/DeleteSpec.scala +++ b/mysql/src/test/scala/zio/sql/mysql/DeleteSpec.scala @@ -4,7 +4,7 @@ import zio.test._ import java.util.UUID import java.time.LocalDate -import zio.schema.DeriveSchema +import zio.schema.{ DeriveSchema, Schema } import zio.test.TestAspect.sequential import zio.sql.table._ @@ -12,7 +12,8 @@ object DeleteSpec extends MysqlRunnableSpec { case class Customers(id: UUID, dob: LocalDate, first_name: String, lastName: String, verified: Boolean) - implicit val customerSchema = DeriveSchema.gen[Customers] + implicit val customerSchema: Schema.CaseClass5[UUID, LocalDate, String, String, Boolean, Customers] = + DeriveSchema.gen[Customers] val customers = Table.defineTable[Customers] diff --git a/mysql/src/test/scala/zio/sql/mysql/MysqlModuleSpec.scala b/mysql/src/test/scala/zio/sql/mysql/MysqlModuleSpec.scala index d3a423b6a..84e6df905 100644 --- a/mysql/src/test/scala/zio/sql/mysql/MysqlModuleSpec.scala +++ b/mysql/src/test/scala/zio/sql/mysql/MysqlModuleSpec.scala @@ -16,7 +16,8 @@ object MysqlModuleSpec extends MysqlRunnableSpec { case class Customers(id: UUID, dob: LocalDate, first_name: String, last_name: String, verified: Boolean) - implicit val customerSchema = DeriveSchema.gen[Customers] + implicit val customerSchema: Schema.CaseClass5[UUID, LocalDate, String, String, Boolean, Customers] = + DeriveSchema.gen[Customers] val customers = Table.defineTable[Customers] @@ -24,14 +25,16 @@ object MysqlModuleSpec extends MysqlRunnableSpec { case class Orders(id: UUID, customer_id: UUID, order_date: LocalDate, deleted_at: Option[LocalDateTime]) - implicit val orderSchema = DeriveSchema.gen[Orders] + implicit val orderSchema: Schema.CaseClass4[UUID, UUID, LocalDate, Option[LocalDateTime], Orders] = + DeriveSchema.gen[Orders] val orders = Table.defineTable[Orders] val (orderId, fkCustomerId, orderDate, deletedAt) = orders.columns case class ProductPrice(productId: UUID, effective: LocalDate, price: BigDecimal) - implicit val productPriceSchema = DeriveSchema.gen[ProductPrice] + implicit val productPriceSchema: Schema.CaseClass3[UUID, LocalDate, BigDecimal, ProductPrice] = + DeriveSchema.gen[ProductPrice] val productPrices = Table.defineTableSmart[ProductPrice] @@ -39,7 +42,8 @@ object MysqlModuleSpec extends MysqlRunnableSpec { case class OrderDetails(orderId: UUID, productId: UUID, quantity: Int, unitPrice: BigDecimal) - implicit val orderDetailsSchema = DeriveSchema.gen[OrderDetails] + implicit val orderDetailsSchema: Schema.CaseClass4[UUID, UUID, Int, BigDecimal, OrderDetails] = + DeriveSchema.gen[OrderDetails] val orderDetails = Table.defineTableSmart[OrderDetails] @@ -136,7 +140,7 @@ object MysqlModuleSpec extends MysqlRunnableSpec { UUID.fromString("636ae137-5b1a-4c8c-b11f-c47c624d9cdc"), "Jose", "Wiggins", - false, + verified = false, LocalDate.parse("1987-03-23") ) ) @@ -282,8 +286,8 @@ object MysqlModuleSpec extends MysqlRunnableSpec { ) val rows = List( - CustomerRow(UUID.randomUUID(), LocalDate.ofYearDay(2001, 8), "Peter", "Parker", true), - CustomerRow(UUID.randomUUID(), LocalDate.ofYearDay(1980, 2), "Stephen", "Strange", false) + CustomerRow(UUID.randomUUID(), LocalDate.ofYearDay(2001, 8), "Peter", "Parker", verified = true), + CustomerRow(UUID.randomUUID(), LocalDate.ofYearDay(1980, 2), "Stephen", "Strange", verified = false) ) val command = insertInto(customers)( diff --git a/mysql/src/test/scala/zio/sql/mysql/TransactionSpec.scala b/mysql/src/test/scala/zio/sql/mysql/TransactionSpec.scala index b22d8ca8b..10e3f835e 100644 --- a/mysql/src/test/scala/zio/sql/mysql/TransactionSpec.scala +++ b/mysql/src/test/scala/zio/sql/mysql/TransactionSpec.scala @@ -15,7 +15,8 @@ object TransactionSpec extends MysqlRunnableSpec with Jdbc { case class Customers(id: UUID, dob: LocalDate, first_name: String, last_name: String, verified: Boolean) - implicit val customerSchema = DeriveSchema.gen[Customers] + implicit val customerSchema: Schema.CaseClass5[UUID, LocalDate, String, String, Boolean, Customers] = + DeriveSchema.gen[Customers] val customers = Table.defineTable[Customers] diff --git a/oracle/src/test/scala/zio/sql/oracle/DualSchema.scala b/oracle/src/test/scala/zio/sql/oracle/DualSchema.scala index cc62e5924..93b7c24ba 100644 --- a/oracle/src/test/scala/zio/sql/oracle/DualSchema.scala +++ b/oracle/src/test/scala/zio/sql/oracle/DualSchema.scala @@ -1,14 +1,14 @@ package zio.sql.oracle -import zio.schema.DeriveSchema +import zio.schema.{ DeriveSchema, Schema } import zio.sql.table._ trait DualSchema { object Dual { case class Dual(dummy: String) - implicit val dummySchema = DeriveSchema.gen[Dual] - val dual = Table.defineTable[Dual] - val dummy = dual.columns + implicit val dummySchema: Schema.CaseClass1[String, Dual] = DeriveSchema.gen[Dual] + val dual = Table.defineTable[Dual] + val dummy = dual.columns } } diff --git a/oracle/src/test/scala/zio/sql/oracle/OracleSqlModuleSpec.scala b/oracle/src/test/scala/zio/sql/oracle/OracleSqlModuleSpec.scala index f7672bc50..3958abfd3 100644 --- a/oracle/src/test/scala/zio/sql/oracle/OracleSqlModuleSpec.scala +++ b/oracle/src/test/scala/zio/sql/oracle/OracleSqlModuleSpec.scala @@ -137,8 +137,8 @@ object OracleSqlModuleSpec extends OracleRunnableSpec with ShopSchema { test("Can insert rows") { val rows = List( - Customers.Customers(UUID.randomUUID(), LocalDate.ofYearDay(2001, 8), "Peter", "Parker", true), - Customers.Customers(UUID.randomUUID(), LocalDate.ofYearDay(1980, 2), "Stephen", "Strange", false) + Customers.Customers(UUID.randomUUID(), LocalDate.ofYearDay(2001, 8), "Peter", "Parker", verified = true), + Customers.Customers(UUID.randomUUID(), LocalDate.ofYearDay(1980, 2), "Stephen", "Strange", verified = false) ) val command = insertInto(customers)( diff --git a/oracle/src/test/scala/zio/sql/oracle/ShopSchema.scala b/oracle/src/test/scala/zio/sql/oracle/ShopSchema.scala index 6958ef9c3..4a4ac8365 100644 --- a/oracle/src/test/scala/zio/sql/oracle/ShopSchema.scala +++ b/oracle/src/test/scala/zio/sql/oracle/ShopSchema.scala @@ -4,7 +4,7 @@ import java.math.BigDecimal import java.util.UUID import java.time._ import zio.Chunk -import zio.schema.DeriveSchema +import zio.schema.{ DeriveSchema, Schema } import zio.sql.table._ trait ShopSchema extends OracleSqlModule { self => @@ -13,7 +13,8 @@ trait ShopSchema extends OracleSqlModule { self => case class Customers(id: UUID, dob: LocalDate, first_name: String, last_name: String, verified: Boolean) - implicit val customerSchema = DeriveSchema.gen[Customers] + implicit val customerSchema: Schema.CaseClass5[UUID, LocalDate, String, String, Boolean, Customers] = + DeriveSchema.gen[Customers] val customers = Table.defineTableSmart[Customers] @@ -22,7 +23,7 @@ trait ShopSchema extends OracleSqlModule { self => object Orders { case class Order(id: UUID, customerId: UUID, orderDate: LocalDate) - implicit val orderSchema = DeriveSchema.gen[Order] + implicit val orderSchema: Schema.CaseClass3[UUID, UUID, LocalDate, Order] = DeriveSchema.gen[Order] val orders = Table.defineTableSmart[Order] @@ -31,7 +32,8 @@ trait ShopSchema extends OracleSqlModule { self => object ProductPrices { case class ProductPrice(productId: UUID, effective: LocalDate, price: BigDecimal) - implicit val productPriceSchema = DeriveSchema.gen[ProductPrice] + implicit val productPriceSchema: Schema.CaseClass3[UUID, LocalDate, BigDecimal, ProductPrice] = + DeriveSchema.gen[ProductPrice] val productPrices = Table.defineTableSmart[ProductPrice] @@ -41,7 +43,8 @@ trait ShopSchema extends OracleSqlModule { self => object OrderDetailsSchema { case class OrderDetails(orderId: UUID, productId: UUID, quantity: Int, unitPrice: BigDecimal) - implicit val orderDetailsSchema = DeriveSchema.gen[OrderDetails] + implicit val orderDetailsSchema: Schema.CaseClass4[UUID, UUID, Int, BigDecimal, OrderDetails] = + DeriveSchema.gen[OrderDetails] val orderDetails = Table.defineTableSmart[OrderDetails] @@ -73,7 +76,29 @@ trait ShopSchema extends OracleSqlModule { self => zoneddatetime: ZonedDateTime ) - implicit val alTypesSchema = DeriveSchema.gen[AllType] + implicit val alTypesSchema: Schema.CaseClass20[ + UUID, + Chunk[Byte], + BigDecimal, + Boolean, + Char, + Double, + Float, + Instant, + Int, + Option[Int], + LocalDate, + LocalDateTime, + LocalTime, + Long, + OffsetDateTime, + OffsetTime, + Short, + String, + UUID, + ZonedDateTime, + AllType + ] = DeriveSchema.gen[AllType] val allTypes = Table.defineTableSmart[AllType] diff --git a/postgres/src/test/scala/zio/sql/postgresql/CustomFunctionDefSpec.scala b/postgres/src/test/scala/zio/sql/postgresql/CustomFunctionDefSpec.scala index c2f89ff5d..05e13a894 100644 --- a/postgres/src/test/scala/zio/sql/postgresql/CustomFunctionDefSpec.scala +++ b/postgres/src/test/scala/zio/sql/postgresql/CustomFunctionDefSpec.scala @@ -436,7 +436,7 @@ object CustomFunctionDefSpec extends PostgresRunnableSpec with DbSchema { UUID.fromString("60b01fc9-c902-4468-8d49-3c0f989def37"), "Ronald", "Russell", - true, + verified = true, LocalDate.parse("1983-01-05") ) ) diff --git a/postgres/src/test/scala/zio/sql/postgresql/DbSchema.scala b/postgres/src/test/scala/zio/sql/postgresql/DbSchema.scala index 9f2a3a940..1a43e3d49 100644 --- a/postgres/src/test/scala/zio/sql/postgresql/DbSchema.scala +++ b/postgres/src/test/scala/zio/sql/postgresql/DbSchema.scala @@ -2,7 +2,7 @@ package zio.sql.postgresql import java.time.{ LocalDate, ZonedDateTime } import java.util.UUID -import zio.schema.DeriveSchema +import zio.schema.{ DeriveSchema, Schema } import java.math.BigDecimal import zio.sql.table._ import zio.sql.select._ @@ -14,18 +14,19 @@ trait DbSchema extends PostgresJdbcModule { self => case class MetroSystem(id: Int, cityId: Int, name: String, dailyRidership: Int) case class MetroLine(id: Int, systemId: Int, name: String, stationCount: Int, trackType: Int) - implicit val citySchema = DeriveSchema.gen[City] + implicit val citySchema: Schema.CaseClass5[Int, String, Int, Float, Option[String], City] = DeriveSchema.gen[City] val city = Table.defineTable[City] val (cityId, cityName, population, area, link) = city.columns - implicit val metroSystemSchema = DeriveSchema.gen[MetroSystem] + implicit val metroSystemSchema: Schema.CaseClass4[Int, Int, String, Int, MetroSystem] = + DeriveSchema.gen[MetroSystem] val metroSystem = Table.defineTable[MetroSystem] val (metroSystemId, cityIdFk, metroSystemName, dailyRidership) = metroSystem.columns - implicit val metroLineSchema = DeriveSchema.gen[MetroLine] + implicit val metroLineSchema: Schema.CaseClass5[Int, Int, String, Int, Int, MetroLine] = DeriveSchema.gen[MetroLine] val metroLine = Table.defineTable[MetroLine] @@ -64,7 +65,9 @@ trait DbSchema extends PostgresJdbcModule { self => createdTimestamp: ZonedDateTime ) - implicit val custommerSchema = DeriveSchema.gen[Customer] + implicit val custommerSchema + : Schema.CaseClass7[UUID, LocalDate, String, String, Boolean, String, ZonedDateTime, Customer] = + DeriveSchema.gen[Customer] val customers = Table.defineTableSmart[Customer] @@ -77,7 +80,7 @@ trait DbSchema extends PostgresJdbcModule { self => object OrdersSchema { case class Orders(id: UUID, customerId: UUID, orderDate: LocalDate) - implicit val orderSchema = DeriveSchema.gen[Orders] + implicit val orderSchema: Schema.CaseClass3[UUID, UUID, LocalDate, Orders] = DeriveSchema.gen[Orders] val orders = Table.defineTableSmart[Orders] @@ -87,7 +90,7 @@ trait DbSchema extends PostgresJdbcModule { self => object ProductSchema { case class Products(id: UUID, name: String, description: String, imageUrl: String) - implicit val productSchema = DeriveSchema.gen[Products] + implicit val productSchema: Schema.CaseClass4[UUID, String, String, String, Products] = DeriveSchema.gen[Products] val products = Table.defineTableSmart[Products] @@ -96,7 +99,8 @@ trait DbSchema extends PostgresJdbcModule { self => object ProductPrices { case class ProductPrice(productId: UUID, effective: LocalDate, price: BigDecimal) - implicit val productPriceSchema = DeriveSchema.gen[ProductPrice] + implicit val productPriceSchema: Schema.CaseClass3[UUID, LocalDate, BigDecimal, ProductPrice] = + DeriveSchema.gen[ProductPrice] val productPrices = Table.defineTableSmart[ProductPrice] @@ -106,7 +110,8 @@ trait DbSchema extends PostgresJdbcModule { self => object OrderDetailsSchema { case class OrderDetails(orderId: UUID, productId: UUID, quantity: Int, unitPrice: BigDecimal) - implicit val orderDetailsSchema = DeriveSchema.gen[OrderDetails] + implicit val orderDetailsSchema: Schema.CaseClass4[UUID, UUID, Int, BigDecimal, OrderDetails] = + DeriveSchema.gen[OrderDetails] val orderDetails = Table.defineTableSmart[OrderDetails] @@ -116,7 +121,8 @@ trait DbSchema extends PostgresJdbcModule { self => object PersonsSchema { case class Persons(id: UUID, name: Option[String], birthDate: Option[LocalDate]) - implicit val personsSchema = DeriveSchema.gen[Persons] + implicit val personsSchema: Schema.CaseClass3[UUID, Option[String], Option[LocalDate], Persons] = + DeriveSchema.gen[Persons] val persons = Table.defineTableSmart[Persons] @@ -127,7 +133,7 @@ trait DbSchema extends PostgresJdbcModule { self => case class Movies(id: Int, rating: Option[Int]) - implicit val moviesSchema = DeriveSchema.gen[Movies] + implicit val moviesSchema: Schema.CaseClass2[Int, Option[Int], Movies] = DeriveSchema.gen[Movies] val movies = Table.defineTableSmart[Movies] diff --git a/postgres/src/test/scala/zio/sql/postgresql/DeleteBatchSpec.scala b/postgres/src/test/scala/zio/sql/postgresql/DeleteBatchSpec.scala index 6257c05b6..2c9c88e07 100644 --- a/postgres/src/test/scala/zio/sql/postgresql/DeleteBatchSpec.scala +++ b/postgres/src/test/scala/zio/sql/postgresql/DeleteBatchSpec.scala @@ -37,7 +37,7 @@ object DeleteBatchSpec extends PostgresRunnableSpec with DbSchema { LocalDate.now(), "fnameCustomer1", "lnameCustomer1", - true, + verified = true, LocalDate.now().toString, ZonedDateTime.now() ) @@ -46,7 +46,7 @@ object DeleteBatchSpec extends PostgresRunnableSpec with DbSchema { LocalDate.now(), "fnameCustomer2", "lnameCustomer2", - true, + verified = true, LocalDate.now().toString, ZonedDateTime.now() ) @@ -55,7 +55,7 @@ object DeleteBatchSpec extends PostgresRunnableSpec with DbSchema { LocalDate.now(), "fnameCustomer3", "lnameCustomer3", - true, + verified = true, LocalDate.now().toString, ZonedDateTime.now() ) @@ -64,7 +64,7 @@ object DeleteBatchSpec extends PostgresRunnableSpec with DbSchema { LocalDate.now(), "fnameCustomer4", "lnameCustomer4", - false, + verified = false, LocalDate.now().toString, ZonedDateTime.now() ) diff --git a/postgres/src/test/scala/zio/sql/postgresql/DeleteSpec.scala b/postgres/src/test/scala/zio/sql/postgresql/DeleteSpec.scala index 37c21866c..d61bdf93e 100644 --- a/postgres/src/test/scala/zio/sql/postgresql/DeleteSpec.scala +++ b/postgres/src/test/scala/zio/sql/postgresql/DeleteSpec.scala @@ -4,7 +4,7 @@ import zio.test._ import java.util.UUID import java.time.LocalDate import java.time.ZonedDateTime -import zio.schema.DeriveSchema +import zio.schema.{ DeriveSchema, Schema } import zio.sql.table._ object DeleteSpec extends PostgresRunnableSpec { @@ -19,7 +19,9 @@ object DeleteSpec extends PostgresRunnableSpec { createdTimestamp: ZonedDateTime ) - implicit val custommerSchema = DeriveSchema.gen[Customers] + implicit val custommerSchema + : Schema.CaseClass7[UUID, LocalDate, String, String, Boolean, String, ZonedDateTime, Customers] = + DeriveSchema.gen[Customers] val customers = Table.defineTable[Customers] diff --git a/postgres/src/test/scala/zio/sql/postgresql/InsertBatchSpec.scala b/postgres/src/test/scala/zio/sql/postgresql/InsertBatchSpec.scala index 1d6397c63..7bff93468 100644 --- a/postgres/src/test/scala/zio/sql/postgresql/InsertBatchSpec.scala +++ b/postgres/src/test/scala/zio/sql/postgresql/InsertBatchSpec.scala @@ -22,7 +22,7 @@ object InsertBatchSpec extends PostgresRunnableSpec with DbSchema { LocalDate.now(), "fnameCustomer1", "lnameCustomer1", - true, + verified = true, LocalDate.now().toString, ZonedDateTime.now() ) @@ -31,7 +31,7 @@ object InsertBatchSpec extends PostgresRunnableSpec with DbSchema { LocalDate.now(), "fnameCustomer2", "lnameCustomer2", - true, + verified = true, LocalDate.now().toString, ZonedDateTime.now() ) @@ -40,7 +40,7 @@ object InsertBatchSpec extends PostgresRunnableSpec with DbSchema { LocalDate.now(), "fnameCustomer3", "lnameCustomer3", - true, + verified = true, LocalDate.now().toString, ZonedDateTime.now() ) @@ -49,7 +49,7 @@ object InsertBatchSpec extends PostgresRunnableSpec with DbSchema { LocalDate.now(), "fnameCustomer4", "lnameCustomer4", - false, + verified = false, LocalDate.now().toString, ZonedDateTime.now() ) diff --git a/postgres/src/test/scala/zio/sql/postgresql/PostgresSqlModuleSpec.scala b/postgres/src/test/scala/zio/sql/postgresql/PostgresSqlModuleSpec.scala index e33d211d3..83c62330b 100644 --- a/postgres/src/test/scala/zio/sql/postgresql/PostgresSqlModuleSpec.scala +++ b/postgres/src/test/scala/zio/sql/postgresql/PostgresSqlModuleSpec.scala @@ -32,7 +32,7 @@ object PostgresSqlModuleSpec extends PostgresRunnableSpec with DbSchema { UUID.fromString("636ae137-5b1a-4c8c-b11f-c47c624d9cdc"), "Jose", "Wiggins", - false, + verified = false, LocalDate.parse("1987-03-23") ) ) @@ -450,7 +450,15 @@ object PostgresSqlModuleSpec extends PostgresRunnableSpec with DbSchema { val created = ZonedDateTime.now() val data = - CustomerRow(UUID.randomUUID(), "Jaro", "Regec", true, LocalDate.ofYearDay(1990, 1), created.toString, created) + CustomerRow( + UUID.randomUUID(), + "Jaro", + "Regec", + verified = true, + LocalDate.ofYearDay(1990, 1), + created.toString, + created + ) implicit val customerRowSchema = Schema.CaseClass7[UUID, String, String, Boolean, LocalDate, String, ZonedDateTime, CustomerRow]( @@ -647,7 +655,6 @@ object PostgresSqlModuleSpec extends PostgresRunnableSpec with DbSchema { test("in joined tables, columns of the same name from different table are treated as different columns") { import Cities._ import Ordering._ - import Expr._ /** * SELECT ms.name, c.name, COUNT(ml.id) as line_count diff --git a/postgres/src/test/scala/zio/sql/postgresql/TransactionSpec.scala b/postgres/src/test/scala/zio/sql/postgresql/TransactionSpec.scala index ffdadc64b..00cdf579c 100644 --- a/postgres/src/test/scala/zio/sql/postgresql/TransactionSpec.scala +++ b/postgres/src/test/scala/zio/sql/postgresql/TransactionSpec.scala @@ -51,7 +51,7 @@ object TransactionSpec extends PostgresRunnableSpec with DbSchema { LocalDate.now(), "fnameCustomer1", "lnameCustomer1", - true, + verified = true, LocalDate.now().toString, ZonedDateTime.now() ) @@ -60,7 +60,7 @@ object TransactionSpec extends PostgresRunnableSpec with DbSchema { LocalDate.now(), "fnameCustomer2", "lnameCustomer2", - true, + verified = true, LocalDate.now().toString, ZonedDateTime.now() ) @@ -89,7 +89,7 @@ object TransactionSpec extends PostgresRunnableSpec with DbSchema { LocalDate.now(), "fnameCustomer1", "lnameCustomer1", - true, + verified = true, LocalDate.now().toString, ZonedDateTime.now() ) @@ -98,7 +98,7 @@ object TransactionSpec extends PostgresRunnableSpec with DbSchema { LocalDate.now(), "fnameCustomer2", "lnameCustomer2", - true, + verified = true, LocalDate.now().toString, ZonedDateTime.now() ) diff --git a/postgres/src/test/scala/zio/sql/postgresql/UpdateBatchSpec.scala b/postgres/src/test/scala/zio/sql/postgresql/UpdateBatchSpec.scala index 04dad2230..bd704f0c0 100644 --- a/postgres/src/test/scala/zio/sql/postgresql/UpdateBatchSpec.scala +++ b/postgres/src/test/scala/zio/sql/postgresql/UpdateBatchSpec.scala @@ -27,7 +27,7 @@ object UpdateBatchSpec extends PostgresRunnableSpec with DbSchema { LocalDate.now(), "fnameCustomer1", "lnameCustomer1", - true, + verified = true, LocalDate.now().toString, ZonedDateTime.now() ) @@ -36,7 +36,7 @@ object UpdateBatchSpec extends PostgresRunnableSpec with DbSchema { LocalDate.now(), "fnameCustomer2", "lnameCustomer2", - true, + verified = true, LocalDate.now().toString, ZonedDateTime.now() ) @@ -45,7 +45,7 @@ object UpdateBatchSpec extends PostgresRunnableSpec with DbSchema { LocalDate.now(), "fnameCustomer3", "lnameCustomer3", - true, + verified = true, LocalDate.now().toString, ZonedDateTime.now() ) @@ -54,7 +54,7 @@ object UpdateBatchSpec extends PostgresRunnableSpec with DbSchema { LocalDate.now(), "fnameCustomer4", "lnameCustomer4", - false, + verified = false, LocalDate.now().toString, ZonedDateTime.now() ) diff --git a/project/BuildHelper.scala b/project/BuildHelper.scala index a6ee526e3..395846643 100644 --- a/project/BuildHelper.scala +++ b/project/BuildHelper.scala @@ -9,10 +9,9 @@ import BuildInfoKeys._ import scalafix.sbt.ScalafixPlugin.autoImport.scalafixSemanticdb object BuildHelper { - val SilencerVersion = "1.17.13" - val Scala212 = "2.12.19" - val Scala213 = "2.13.10" - val ScalaDotty = "3.3.0" + val Scala212 = "2.12.19" + val Scala213 = "2.13.13" + val ScalaDotty = "3.3.0" def buildInfoSettings(packageName: String) = Seq( @@ -150,17 +149,6 @@ object BuildHelper { crossScalaVersions := Seq(Scala213, Scala212), ThisBuild / scalaVersion := Scala213, scalacOptions := stdOptions ++ extraOptions(scalaVersion.value, optimize = !isSnapshot.value), - libraryDependencies ++= { - if (scalaVersion.value == ScalaDotty) - Seq( - "com.github.ghik" % s"silencer-lib_2.13.10" % SilencerVersion % Provided - ) - else - Seq( - ("com.github.ghik" % "silencer-lib" % SilencerVersion % Provided).cross(CrossVersion.full), - compilerPlugin(("com.github.ghik" % "silencer-plugin" % SilencerVersion).cross(CrossVersion.full)) - ) - }, resolvers ++= Resolver.sonatypeOssRepos("snapshots"), Test / parallelExecution := true, incOptions ~= (_.withLogRecompileOnMacro(false)), diff --git a/project/plugins.sbt b/project/plugins.sbt index 710e045d8..77f1bc83e 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,12 +1,12 @@ -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.13.2") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0") addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7") -addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0") +addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.12.0") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.11") -addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.9") +addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.17") addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.3.1") -addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.1") -addSbtPlugin("org.typelevel" % "sbt-tpolecat" % "0.5.0") +addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.0") +addSbtPlugin("org.typelevel" % "sbt-tpolecat" % "0.5.1") addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.3.10") diff --git a/sqlserver/src/test/scala/zio/sql/sqlserver/DbSchema.scala b/sqlserver/src/test/scala/zio/sql/sqlserver/DbSchema.scala index 060d59298..fbac3c0bd 100644 --- a/sqlserver/src/test/scala/zio/sql/sqlserver/DbSchema.scala +++ b/sqlserver/src/test/scala/zio/sql/sqlserver/DbSchema.scala @@ -3,7 +3,7 @@ package zio.sql.sqlserver import java.util.UUID import java.time._ import java.math.BigDecimal -import zio.schema.DeriveSchema +import zio.schema.{ DeriveSchema, Schema } import zio.sql.table._ import zio.sql.select._ @@ -21,7 +21,9 @@ trait DbSchema extends SqlServerSqlModule { self => createdTimestamp: ZonedDateTime ) - implicit val custommerSchema = DeriveSchema.gen[Customer] + implicit val custommerSchema + : Schema.CaseClass7[UUID, LocalDate, String, String, Boolean, String, ZonedDateTime, Customer] = + DeriveSchema.gen[Customer] val customers = Table.defineTableSmart[Customer] @@ -32,7 +34,7 @@ trait DbSchema extends SqlServerSqlModule { self => case class Orders(id: UUID, customerId: UUID, orderDate: LocalDate) - implicit val orderSchema = DeriveSchema.gen[Orders] + implicit val orderSchema: Schema.CaseClass3[UUID, UUID, LocalDate, Orders] = DeriveSchema.gen[Orders] val orders = Table.defineTableSmart[Orders] @@ -40,7 +42,7 @@ trait DbSchema extends SqlServerSqlModule { self => case class Products(id: UUID, name: String, description: String, imageUrl: String) - implicit val productSchema = DeriveSchema.gen[Products] + implicit val productSchema: Schema.CaseClass4[UUID, String, String, String, Products] = DeriveSchema.gen[Products] val products = Table.defineTableSmart[Products] @@ -48,7 +50,8 @@ trait DbSchema extends SqlServerSqlModule { self => case class OrderDetails(orderId: UUID, productId: UUID, quantity: Int, unitPrice: BigDecimal) - implicit val orderDetailsSchema = DeriveSchema.gen[OrderDetails] + implicit val orderDetailsSchema: Schema.CaseClass4[UUID, UUID, Int, BigDecimal, OrderDetails] = + DeriveSchema.gen[OrderDetails] val orderDetails = Table.defineTableSmart[OrderDetails] diff --git a/sqlserver/src/test/scala/zio/sql/sqlserver/SqlServerModuleSpec.scala b/sqlserver/src/test/scala/zio/sql/sqlserver/SqlServerModuleSpec.scala index f9a721f79..4ca986746 100644 --- a/sqlserver/src/test/scala/zio/sql/sqlserver/SqlServerModuleSpec.scala +++ b/sqlserver/src/test/scala/zio/sql/sqlserver/SqlServerModuleSpec.scala @@ -5,7 +5,7 @@ import java.time._ import java.time.temporal.ChronoUnit import java.util.UUID import zio._ -import zio.schema.DeriveSchema +import zio.schema.{ DeriveSchema, Schema } import zio.test._ import zio.test.Assertion._ import zio.test.TestAspect.{ retries, samples, sequential, shrinks } @@ -27,7 +27,8 @@ object SqlServerModuleSpec extends SqlServerRunnableSpec { dateOfBirth: LocalDate ) - implicit val customerRow = DeriveSchema.gen[CustomerRow] + implicit val customerRow: Schema.CaseClass5[UUID, String, String, Boolean, LocalDate, CustomerRow] = + DeriveSchema.gen[CustomerRow] private def customerSelectJoseAssertion[F]( condition: Expr[F, customers.TableType, Boolean] @@ -43,7 +44,7 @@ object SqlServerModuleSpec extends SqlServerRunnableSpec { UUID.fromString("636ae137-5b1a-4c8c-b11f-c47c624d9cdc"), "Jose", "Wiggins", - false, + verified = false, LocalDate.parse("1987-03-23") ) ) @@ -674,8 +675,8 @@ object SqlServerModuleSpec extends SqlServerRunnableSpec { test("Can insert rows") { val rows = List( - CustomerRow(UUID.randomUUID(), "Peter", "Parker", true, LocalDate.ofYearDay(2001, 8)), - CustomerRow(UUID.randomUUID(), "Stephen", "Strange", false, LocalDate.ofYearDay(1980, 2)) + CustomerRow(UUID.randomUUID(), "Peter", "Parker", verified = true, LocalDate.ofYearDay(2001, 8)), + CustomerRow(UUID.randomUUID(), "Stephen", "Strange", verified = false, LocalDate.ofYearDay(1980, 2)) ) val command = insertInto(customers)( @@ -954,7 +955,8 @@ object SqlServerModuleSpec extends SqlServerRunnableSpec { object CustomerSchema { case class Customers(id: UUID, firstName: String, lastName: String, verified: Boolean, dob: LocalDate) - implicit val customerSchema = DeriveSchema.gen[Customers] + implicit val customerSchema: Schema.CaseClass5[UUID, String, String, Boolean, LocalDate, Customers] = + DeriveSchema.gen[Customers] val customers = Table.defineTable[Customers] @@ -965,7 +967,7 @@ object SqlServerModuleSpec extends SqlServerRunnableSpec { object OrderSchema { case class Orders(id: UUID, customerId: UUID, orderDate: LocalDate) - implicit val orderSchema = DeriveSchema.gen[Orders] + implicit val orderSchema: Schema.CaseClass3[UUID, UUID, LocalDate, Orders] = DeriveSchema.gen[Orders] val orders = Table.defineTable[Orders] @@ -975,7 +977,8 @@ object SqlServerModuleSpec extends SqlServerRunnableSpec { object ProductSchema { case class ProductPrices(productId: UUID, effective: OffsetDateTime, price: BigDecimal) - implicit val productPricesSchema = DeriveSchema.gen[ProductPrices] + implicit val productPricesSchema: Schema.CaseClass3[UUID, OffsetDateTime, BigDecimal, ProductPrices] = + DeriveSchema.gen[ProductPrices] val productPrices = Table.defineTable[ProductPrices] @@ -985,7 +988,8 @@ object SqlServerModuleSpec extends SqlServerRunnableSpec { object OrderDetails { case class OrderDetails(orderId: UUID, productId: UUID, quantity: Int, unitPrice: BigDecimal) - implicit val orderDetailsSchema = DeriveSchema.gen[OrderDetails] + implicit val orderDetailsSchema: Schema.CaseClass4[UUID, UUID, Int, BigDecimal, OrderDetails] = + DeriveSchema.gen[OrderDetails] val orderDetails = Table.defineTable[OrderDetails] @@ -1036,7 +1040,29 @@ object SqlServerModuleSpec extends SqlServerRunnableSpec { zoneddatetime: ZonedDateTime ) - implicit val alTypesSchema = DeriveSchema.gen[AllType] + implicit val alTypesSchema: Schema.CaseClass20[ + UUID, + Chunk[Byte], + java.math.BigDecimal, + Boolean, + Char, + Double, + Float, + Instant, + Int, + Option[Int], + LocalDate, + LocalDateTime, + LocalTime, + Long, + OffsetDateTime, + OffsetTime, + Short, + String, + UUID, + ZonedDateTime, + AllType + ] = DeriveSchema.gen[AllType] val allTypes = Table.defineTableSmart[AllType]