diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ad17c91f..7fd59f2ea 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.18', '2.13.12'] + scala: ['2.12.18', '2.13.13'] steps: - name: Checkout current branch uses: actions/checkout@v2.3.4 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/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/MysqlModuleSpec.scala b/mysql/src/test/scala/zio/sql/mysql/MysqlModuleSpec.scala index 662ae3106..84e6df905 100644 --- a/mysql/src/test/scala/zio/sql/mysql/MysqlModuleSpec.scala +++ b/mysql/src/test/scala/zio/sql/mysql/MysqlModuleSpec.scala @@ -140,7 +140,7 @@ object MysqlModuleSpec extends MysqlRunnableSpec { UUID.fromString("636ae137-5b1a-4c8c-b11f-c47c624d9cdc"), "Jose", "Wiggins", - false, + verified = false, LocalDate.parse("1987-03-23") ) ) @@ -286,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/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/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/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/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 fa426eed9..23466085a 100644 --- a/project/BuildHelper.scala +++ b/project/BuildHelper.scala @@ -10,7 +10,7 @@ import scalafix.sbt.ScalafixPlugin.autoImport.scalafixSemanticdb object BuildHelper { val Scala212 = "2.12.18" - val Scala213 = "2.13.12" + val Scala213 = "2.13.13" val ScalaDotty = "3.3.0" def buildInfoSettings(packageName: String) = diff --git a/sqlserver/src/test/scala/zio/sql/sqlserver/SqlServerModuleSpec.scala b/sqlserver/src/test/scala/zio/sql/sqlserver/SqlServerModuleSpec.scala index 844dbe083..4ca986746 100644 --- a/sqlserver/src/test/scala/zio/sql/sqlserver/SqlServerModuleSpec.scala +++ b/sqlserver/src/test/scala/zio/sql/sqlserver/SqlServerModuleSpec.scala @@ -44,7 +44,7 @@ object SqlServerModuleSpec extends SqlServerRunnableSpec { UUID.fromString("636ae137-5b1a-4c8c-b11f-c47c624d9cdc"), "Jose", "Wiggins", - false, + verified = false, LocalDate.parse("1987-03-23") ) ) @@ -675,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)(