From 0b9e58588052bab6898a2d90f09e24077bf40fac Mon Sep 17 00:00:00 2001 From: Hannes Bibel Date: Sat, 8 Apr 2023 10:03:41 +0200 Subject: [PATCH 01/15] #341 - Implement Ltrim2 and Rtrim2 for Postgres and Oracle --- .../test/scala/zio-sql/HelloWorldSpec.scala | 26 ------------------- .../zio/sql/oracle/OracleSqlModule.scala | 3 ++- .../sql/oracle/CommonFunctionDefSpec.scala | 10 ++----- .../sql/oracle/CustomFunctionDefSpec.scala | 25 ++++++++++++++++++ .../scala/zio/sql/oracle/DualSchema.scala | 14 ++++++++++ .../sql/postgresql/PostgresSqlModule.scala | 2 ++ .../postgresql/CustomFunctionDefSpec.scala | 12 ++++++++- 7 files changed, 56 insertions(+), 36 deletions(-) delete mode 100644 core/shared/src/test/scala/zio-sql/HelloWorldSpec.scala create mode 100644 oracle/src/test/scala/zio/sql/oracle/CustomFunctionDefSpec.scala create mode 100644 oracle/src/test/scala/zio/sql/oracle/DualSchema.scala diff --git a/core/shared/src/test/scala/zio-sql/HelloWorldSpec.scala b/core/shared/src/test/scala/zio-sql/HelloWorldSpec.scala deleted file mode 100644 index 3673fdd8f..000000000 --- a/core/shared/src/test/scala/zio-sql/HelloWorldSpec.scala +++ /dev/null @@ -1,26 +0,0 @@ -package zio.sql - -import zio._ -import zio.test._ -import zio.test.Assertion._ - -import HelloWorld._ -import zio.test.ZIOSpecDefault - -object HelloWorld { - - def sayHello: ZIO[Any, Throwable, Unit] = - Console.printLine("Hello, World!") -} - -object HelloWorldSpec extends ZIOSpecDefault { - - def spec = suite("HelloWorldSpec")( - test("sayHello correctly displays output") { - for { - _ <- sayHello - output <- TestConsole.output - } yield assert(output)(equalTo(Vector("Hello, World!\n"))) - } - ) -} diff --git a/oracle/src/main/scala/zio/sql/oracle/OracleSqlModule.scala b/oracle/src/main/scala/zio/sql/oracle/OracleSqlModule.scala index 0549167e2..a22918da2 100644 --- a/oracle/src/main/scala/zio/sql/oracle/OracleSqlModule.scala +++ b/oracle/src/main/scala/zio/sql/oracle/OracleSqlModule.scala @@ -33,6 +33,7 @@ trait OracleSqlModule extends Sql { self => } object OracleFunctionDef { - val Sind = FunctionDef[Double, Double](FunctionName("sind")) + val Ltrim2 = FunctionDef[(String, String), String](FunctionName("ltrim")) + val Rtrim2 = FunctionDef[(String, String), String](FunctionName("rtrim")) } } diff --git a/oracle/src/test/scala/zio/sql/oracle/CommonFunctionDefSpec.scala b/oracle/src/test/scala/zio/sql/oracle/CommonFunctionDefSpec.scala index 1ffb4f6d2..bcf0e05c5 100644 --- a/oracle/src/test/scala/zio/sql/oracle/CommonFunctionDefSpec.scala +++ b/oracle/src/test/scala/zio/sql/oracle/CommonFunctionDefSpec.scala @@ -4,17 +4,11 @@ import zio.Cause import zio.stream.ZStream import zio.test.Assertion._ import zio.test._ -import zio.schema.DeriveSchema import zio.sql.expr.FunctionDef.{ CharLength => _, _ } -import zio.sql.table._ -object CommonFunctionDefSpec extends OracleRunnableSpec with ShopSchema { +object CommonFunctionDefSpec extends OracleRunnableSpec with ShopSchema with DualSchema { import Customers._ - - case class Dual(dummy: String) - implicit val dummySchema = DeriveSchema.gen[Dual] - val dual = Table.defineTable[Dual] - val dommy = dual.columns + import Dual._ private def collectAndCompare[R, E]( expected: Seq[String], diff --git a/oracle/src/test/scala/zio/sql/oracle/CustomFunctionDefSpec.scala b/oracle/src/test/scala/zio/sql/oracle/CustomFunctionDefSpec.scala new file mode 100644 index 000000000..94eefec6b --- /dev/null +++ b/oracle/src/test/scala/zio/sql/oracle/CustomFunctionDefSpec.scala @@ -0,0 +1,25 @@ +package zio.sql.oracle + +import zio.test.Assertion._ +import zio.test.TestAspect.timeout +import zio.test._ +import zio._ + +object CustomFunctionDefSpec extends OracleRunnableSpec with DualSchema { + import OracleFunctionDef._ + + import Dual._ + + override def specLayered = suite("Oracle FunctionDef")( + test("ltrim2") { + assertZIO(execute(select(Ltrim2("$## foo$#", "#$")).from(dual)).runHead.some)( + equalTo(" foo$#") + ) + }, + test("rtrim2") { + assertZIO(execute(select(Rtrim2("$#foo $##", "#$")).from(dual)).runHead.some)( + equalTo("$#foo ") + ) + } + ) @@ timeout(5.minutes) +} diff --git a/oracle/src/test/scala/zio/sql/oracle/DualSchema.scala b/oracle/src/test/scala/zio/sql/oracle/DualSchema.scala new file mode 100644 index 000000000..cc62e5924 --- /dev/null +++ b/oracle/src/test/scala/zio/sql/oracle/DualSchema.scala @@ -0,0 +1,14 @@ +package zio.sql.oracle + +import zio.schema.DeriveSchema +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 + } +} diff --git a/postgres/src/main/scala/zio/sql/postgresql/PostgresSqlModule.scala b/postgres/src/main/scala/zio/sql/postgresql/PostgresSqlModule.scala index 8010b1f72..0b34511e6 100644 --- a/postgres/src/main/scala/zio/sql/postgresql/PostgresSqlModule.scala +++ b/postgres/src/main/scala/zio/sql/postgresql/PostgresSqlModule.scala @@ -250,6 +250,7 @@ trait PostgresSqlModule extends Sql { self => val LocaltimestampWithPrecision = FunctionDef[Int, Instant](FunctionName("localtimestamp")) val LocaltimeWithPrecision = FunctionDef[Int, LocalTime](FunctionName("localtime")) val LPad = FunctionDef[(String, Int, String), String](FunctionName("lpad")) + val Ltrim2 = FunctionDef[(String, String), String](FunctionName("ltrim")) val MakeDate = FunctionDef[(Int, Int, Int), LocalDate](FunctionName("make_date")) val MakeInterval = FunctionDef[Interval, Interval](FunctionName("make_interval")) val MakeTime = FunctionDef[(Int, Int, Double), LocalTime](FunctionName("make_time")) @@ -271,6 +272,7 @@ trait PostgresSqlModule extends Sql { self => val Reverse = FunctionDef[String, String](FunctionName("reverse")) val Right = FunctionDef[(String, Int), String](FunctionName("right")) val RPad = FunctionDef[(String, Int, String), String](FunctionName("rpad")) + val Rtrim2 = FunctionDef[(String, String), String](FunctionName("rtrim")) val SetSeed = FunctionDef[Double, Unit](FunctionName("setseed")) val Sind = FunctionDef[Double, Double](FunctionName("sind")) val SplitPart = FunctionDef[(String, String, Int), String](FunctionName("split_part")) diff --git a/postgres/src/test/scala/zio/sql/postgresql/CustomFunctionDefSpec.scala b/postgres/src/test/scala/zio/sql/postgresql/CustomFunctionDefSpec.scala index 92e565eae..468382dcf 100644 --- a/postgres/src/test/scala/zio/sql/postgresql/CustomFunctionDefSpec.scala +++ b/postgres/src/test/scala/zio/sql/postgresql/CustomFunctionDefSpec.scala @@ -145,7 +145,17 @@ object CustomFunctionDefSpec extends PostgresRunnableSpec with DbSchema { val testResult = execute(query) collectAndCompare(expected, testResult) } - ) + ), + test("ltrim2") { + assertZIO(execute(select(Ltrim2("$## foo$#", "#$"))).runHead.some)( + equalTo(" foo$#") + ) + }, + test("rtrim2") { + assertZIO(execute(select(Rtrim2("$#foo $##", "#$"))).runHead.some)( + equalTo("$#foo ") + ) + } ), test("repeat") { assertZIO(execute(select(Repeat("Zio", 3))).runHead.some)(equalTo("ZioZioZio")) From 652d5a3d5e7e975f84df6553b48e948230e57977 Mon Sep 17 00:00:00 2001 From: Dan Aharon Date: Tue, 30 May 2023 20:06:39 -0700 Subject: [PATCH 02/15] Quoted table names and columns should handle dots. This is so that table names in PostgreSQL like public.users will be rendered with quotes properly, eg. "public"."users" --- .../main/scala/zio/sql/postgresql/PostgresRenderModule.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/postgres/src/main/scala/zio/sql/postgresql/PostgresRenderModule.scala b/postgres/src/main/scala/zio/sql/postgresql/PostgresRenderModule.scala index 89a438bef..955f12a8a 100644 --- a/postgres/src/main/scala/zio/sql/postgresql/PostgresRenderModule.scala +++ b/postgres/src/main/scala/zio/sql/postgresql/PostgresRenderModule.scala @@ -240,7 +240,8 @@ trait PostgresRenderModule extends PostgresSqlModule { self => case _ => () } - private[zio] def quoted(name: String): String = "\"" + name + "\"" + private[zio] def quoted(name: String): String = + name.split('.').map("\"" + _ + "\"").mkString(".") private[zio] def renderExpr[A, B](expr: Expr[_, A, B])(implicit render: Renderer): Unit = expr match { case Expr.Subselect(subselect) => From 8fb0f6623555b8b4850f80c5da0fcc1955f15699 Mon Sep 17 00:00:00 2001 From: tonykwok1992 Date: Thu, 8 Jun 2023 21:36:07 +0800 Subject: [PATCH 03/15] Make null primitive value return None --- .../scala/zio/sql/JdbcInternalModule.scala | 1 + postgres/src/test/resources/db_schema.sql | 8 ++++++ .../scala/zio/sql/postgresql/DbSchema.scala | 13 ++++++++++ .../scala/zio/sql/postgresql/SelectSpec.scala | 26 +++++++++++++++++++ 4 files changed, 48 insertions(+) create mode 100644 postgres/src/test/scala/zio/sql/postgresql/SelectSpec.scala diff --git a/jdbc/src/main/scala/zio/sql/JdbcInternalModule.scala b/jdbc/src/main/scala/zio/sql/JdbcInternalModule.scala index ff3074a03..c07d1ab37 100644 --- a/jdbc/src/main/scala/zio/sql/JdbcInternalModule.scala +++ b/jdbc/src/main/scala/zio/sql/JdbcInternalModule.scala @@ -27,6 +27,7 @@ trait JdbcInternalModule { self: Jdbc => else try { val value = decoder + if (resultSet.wasNull()) return Right(null.asInstanceOf[A]) value match { case Some(value) => Right(value) diff --git a/postgres/src/test/resources/db_schema.sql b/postgres/src/test/resources/db_schema.sql index 3c0d61f1d..db5860ad5 100644 --- a/postgres/src/test/resources/db_schema.sql +++ b/postgres/src/test/resources/db_schema.sql @@ -78,6 +78,14 @@ ALTER TABLE metro_line ADD CONSTRAINT metro_line_id PRIMARY KEY(id); ALTER TABLE metro_line ADD CONSTRAINT metro_line_system_fk FOREIGN KEY(system_id) REFERENCES metro_system(id) ON DELETE CASCADE ON UPDATE CASCADE; +create table movies +( + id int not null primary key, + rating int +); + +insert into "movies" ("id", "rating") values (1, null); + insert into "customers" ("id", "first_name", "last_name", "verified", "dob", "created_timestamp_string", "created_timestamp") values diff --git a/postgres/src/test/scala/zio/sql/postgresql/DbSchema.scala b/postgres/src/test/scala/zio/sql/postgresql/DbSchema.scala index e3466b497..9f2a3a940 100644 --- a/postgres/src/test/scala/zio/sql/postgresql/DbSchema.scala +++ b/postgres/src/test/scala/zio/sql/postgresql/DbSchema.scala @@ -122,4 +122,17 @@ trait DbSchema extends PostgresJdbcModule { self => val (personsId, personsName, birthDate) = persons.columns } + + object MoviesSchema { + + case class Movies(id: Int, rating: Option[Int]) + + implicit val moviesSchema = DeriveSchema.gen[Movies] + + val movies = Table.defineTableSmart[Movies] + + val (id, rating) = movies.columns + + } + } diff --git a/postgres/src/test/scala/zio/sql/postgresql/SelectSpec.scala b/postgres/src/test/scala/zio/sql/postgresql/SelectSpec.scala new file mode 100644 index 000000000..665fb7a84 --- /dev/null +++ b/postgres/src/test/scala/zio/sql/postgresql/SelectSpec.scala @@ -0,0 +1,26 @@ +package zio.sql.postgresql + +import zio.Cause +import zio.test.Assertion._ +import zio.test._ + +object SelectSpec extends PostgresRunnableSpec with DbSchema { + + + override def specLayered = suite("Postgres module select")( + test("Select null int value as None Option") { + val movieColumns = MoviesSchema.id ++ MoviesSchema.rating + val selectStmt = select(movieColumns).from(MoviesSchema.movies).where(MoviesSchema.id === 1) + val selectResult = execute(selectStmt.to((MoviesSchema.Movies.apply _).tupled)).runCollect + + val insertAssertion = for { + movies <- selectResult + } yield assert(movies.toList)(equalTo(List(MoviesSchema.Movies( + id = 1, + rating = None + )))) + insertAssertion.mapErrorCause(cause => Cause.stackless(cause.untraced)) + } + ) + +} From 9b16b833aa2e95e27d62b05c946fcae6229b0a47 Mon Sep 17 00:00:00 2001 From: tonykwok1992 Date: Fri, 9 Jun 2023 16:00:53 +0800 Subject: [PATCH 04/15] run sbt fmt --- .../scala/zio/sql/postgresql/SelectSpec.scala | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/postgres/src/test/scala/zio/sql/postgresql/SelectSpec.scala b/postgres/src/test/scala/zio/sql/postgresql/SelectSpec.scala index 665fb7a84..c63a12fef 100644 --- a/postgres/src/test/scala/zio/sql/postgresql/SelectSpec.scala +++ b/postgres/src/test/scala/zio/sql/postgresql/SelectSpec.scala @@ -6,19 +6,25 @@ import zio.test._ object SelectSpec extends PostgresRunnableSpec with DbSchema { - override def specLayered = suite("Postgres module select")( test("Select null int value as None Option") { val movieColumns = MoviesSchema.id ++ MoviesSchema.rating - val selectStmt = select(movieColumns).from(MoviesSchema.movies).where(MoviesSchema.id === 1) + val selectStmt = select(movieColumns).from(MoviesSchema.movies).where(MoviesSchema.id === 1) val selectResult = execute(selectStmt.to((MoviesSchema.Movies.apply _).tupled)).runCollect - val insertAssertion = for { - movies <- selectResult - } yield assert(movies.toList)(equalTo(List(MoviesSchema.Movies( - id = 1, - rating = None - )))) + val insertAssertion = + for { + movies <- selectResult + } yield assert(movies.toList)( + equalTo( + List( + MoviesSchema.Movies( + id = 1, + rating = None + ) + ) + ) + ) insertAssertion.mapErrorCause(cause => Cause.stackless(cause.untraced)) } ) From abbe24d522338a0e9f076047f19d7cc78d949b58 Mon Sep 17 00:00:00 2001 From: jczuchnowski Date: Fri, 9 Jun 2023 16:04:36 +0200 Subject: [PATCH 05/15] Increase CI stack size --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6db45b2ab..cc3d8dd8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,8 +1,8 @@ name: CI env: - JDK_JAVA_OPTIONS: -XX:+PrintCommandLineFlags -XX:+UseG1GC -Xmx4g -Xms4g - JVM_OPTS: -XX:+PrintCommandLineFlags -XX:+UseG1GC -Xmx4g -Xms4g + JDK_JAVA_OPTIONS: -XX:+PrintCommandLineFlags -XX:+UseG1GC -Xmx4g -Xms4g -Xss4m + JVM_OPTS: -XX:+PrintCommandLineFlags -XX:+UseG1GC -Xmx4g -Xms4g -Xss4m on: pull_request: From 512b881fab0cd320272a52f1d0131a917a7a9f31 Mon Sep 17 00:00:00 2001 From: tonykwok1992 Date: Mon, 12 Jun 2023 15:58:10 +0800 Subject: [PATCH 06/15] Move test to PostgresSqlModuleSpec --- .../postgresql/PostgresSqlModuleSpec.scala | 22 ++++++++++++- .../scala/zio/sql/postgresql/SelectSpec.scala | 32 ------------------- 2 files changed, 21 insertions(+), 33 deletions(-) delete mode 100644 postgres/src/test/scala/zio/sql/postgresql/SelectSpec.scala diff --git a/postgres/src/test/scala/zio/sql/postgresql/PostgresSqlModuleSpec.scala b/postgres/src/test/scala/zio/sql/postgresql/PostgresSqlModuleSpec.scala index 00d8bc884..81430b390 100644 --- a/postgres/src/test/scala/zio/sql/postgresql/PostgresSqlModuleSpec.scala +++ b/postgres/src/test/scala/zio/sql/postgresql/PostgresSqlModuleSpec.scala @@ -3,7 +3,6 @@ package zio.sql.postgresql import java.math.BigDecimal import java.time._ import java.util.UUID - import zio._ import zio.schema._ import zio.test._ @@ -12,6 +11,7 @@ import zio.test.TestAspect._ import zio.sql.expr.AggregationDef._ import zio.sql.expr._ import zio.sql.select._ + import scala.language.postfixOps object PostgresSqlModuleSpec extends PostgresRunnableSpec with DbSchema { @@ -703,6 +703,26 @@ object PostgresSqlModuleSpec extends PostgresRunnableSpec with DbSchema { orders <- execute(allOrders).runCollect products <- execute(allProducts).runCollect } yield assertTrue(customers.length == 2) && assertTrue(orders.length == 35) && assertTrue(products.length == 10) + }, + test("Select null int value as None Option") { + val movieColumns = MoviesSchema.id ++ MoviesSchema.rating + val selectStmt = select(movieColumns).from(MoviesSchema.movies).where(MoviesSchema.id === 1) + val selectResult = execute(selectStmt.to((MoviesSchema.Movies.apply _).tupled)).runCollect + + val insertAssertion = + for { + movies <- selectResult + } yield assert(movies.toList)( + equalTo( + List( + MoviesSchema.Movies( + id = 1, + rating = None + ) + ) + ) + ) + insertAssertion.mapErrorCause(cause => Cause.stackless(cause.untraced)) } ) @@ sequential } diff --git a/postgres/src/test/scala/zio/sql/postgresql/SelectSpec.scala b/postgres/src/test/scala/zio/sql/postgresql/SelectSpec.scala deleted file mode 100644 index c63a12fef..000000000 --- a/postgres/src/test/scala/zio/sql/postgresql/SelectSpec.scala +++ /dev/null @@ -1,32 +0,0 @@ -package zio.sql.postgresql - -import zio.Cause -import zio.test.Assertion._ -import zio.test._ - -object SelectSpec extends PostgresRunnableSpec with DbSchema { - - override def specLayered = suite("Postgres module select")( - test("Select null int value as None Option") { - val movieColumns = MoviesSchema.id ++ MoviesSchema.rating - val selectStmt = select(movieColumns).from(MoviesSchema.movies).where(MoviesSchema.id === 1) - val selectResult = execute(selectStmt.to((MoviesSchema.Movies.apply _).tupled)).runCollect - - val insertAssertion = - for { - movies <- selectResult - } yield assert(movies.toList)( - equalTo( - List( - MoviesSchema.Movies( - id = 1, - rating = None - ) - ) - ) - ) - insertAssertion.mapErrorCause(cause => Cause.stackless(cause.untraced)) - } - ) - -} From e594eba1a94b14f155c0eb9a8951e9167fb2ac06 Mon Sep 17 00:00:00 2001 From: tonykwok1992 Date: Mon, 12 Jun 2023 15:59:52 +0800 Subject: [PATCH 07/15] Review comment: return the for comprehension directly in test case --- .../postgresql/PostgresSqlModuleSpec.scala | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/postgres/src/test/scala/zio/sql/postgresql/PostgresSqlModuleSpec.scala b/postgres/src/test/scala/zio/sql/postgresql/PostgresSqlModuleSpec.scala index 81430b390..e33d211d3 100644 --- a/postgres/src/test/scala/zio/sql/postgresql/PostgresSqlModuleSpec.scala +++ b/postgres/src/test/scala/zio/sql/postgresql/PostgresSqlModuleSpec.scala @@ -709,20 +709,18 @@ object PostgresSqlModuleSpec extends PostgresRunnableSpec with DbSchema { val selectStmt = select(movieColumns).from(MoviesSchema.movies).where(MoviesSchema.id === 1) val selectResult = execute(selectStmt.to((MoviesSchema.Movies.apply _).tupled)).runCollect - val insertAssertion = - for { - movies <- selectResult - } yield assert(movies.toList)( - equalTo( - List( - MoviesSchema.Movies( - id = 1, - rating = None - ) + for { + movies <- selectResult + } yield assert(movies.toList)( + equalTo( + List( + MoviesSchema.Movies( + id = 1, + rating = None ) ) ) - insertAssertion.mapErrorCause(cause => Cause.stackless(cause.untraced)) + ) } ) @@ sequential } From 8c0bd472a1a285d4ee4b1433c1eec5ab6d459f90 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Tue, 13 Jun 2023 02:56:13 +0000 Subject: [PATCH 08/15] Update silencer-lib, silencer-plugin to 1.7.13 --- project/BuildHelper.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/BuildHelper.scala b/project/BuildHelper.scala index 6d33d8f7f..e0f22bc6f 100644 --- a/project/BuildHelper.scala +++ b/project/BuildHelper.scala @@ -9,7 +9,7 @@ import BuildInfoKeys._ import scalafix.sbt.ScalafixPlugin.autoImport.scalafixSemanticdb object BuildHelper { - val SilencerVersion = "1.7.12" + val SilencerVersion = "1.7.13" val Scala212 = "2.12.17" val Scala213 = "2.13.10" val ScalaDotty = "3.2.1" From f55613cdb1b318d5c9c8bb67da0da6b574381440 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sun, 18 Jun 2023 22:41:51 +0000 Subject: [PATCH 09/15] Update testcontainers-scala-mssqlserver, ... to 0.40.17 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 8bb85226d..8f2d2afc9 100644 --- a/build.sbt +++ b/build.sbt @@ -26,7 +26,7 @@ addCommandAlias("check", "all scalafmtSbtCheck scalafmtCheck test:scalafmtCheck" val zioVersion = "2.0.6" val zioSchemaVersion = "0.4.2" val testcontainersVersion = "1.17.6" -val testcontainersScalaVersion = "0.40.11" +val testcontainersScalaVersion = "0.40.17" val logbackVersion = "1.2.11" lazy val root = project From d26b51e54fedfbeecff472b76c7c0220916da4ec Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Mon, 3 Jul 2023 01:35:29 +0000 Subject: [PATCH 10/15] Update sbt-scalajs, scalajs-compiler, ... to 1.13.2 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index c81f8d2b7..1e1e93d19 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,4 @@ -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.12.0") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.13.2") addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.2.0") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0") addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3") From 8df4c999538317d83c3e98fb056d6be1dcce4c37 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sun, 9 Jul 2023 10:20:14 +0000 Subject: [PATCH 11/15] Update sbt-scalajs-crossproject to 1.3.2 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index c81f8d2b7..1152d21e2 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,5 +1,5 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.12.0") -addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.2.0") +addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0") addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0") From a027817eeda323403ff2a9dbb92633e00d15943e Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Wed, 19 Jul 2023 03:00:38 +0000 Subject: [PATCH 12/15] Update sbt-bloop to 1.5.9 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index c81f8d2b7..6fb551c36 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -4,7 +4,7 @@ addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0" addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.6") -addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.3") +addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.9") addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.9") addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.2.16") addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.1") From ccc5198563e832190410eda73a903cad984a6b17 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Wed, 19 Jul 2023 03:00:48 +0000 Subject: [PATCH 13/15] Update scalafmt-core to 3.7.10 --- .scalafmt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index 1e658cd37..6c4a46c56 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = "3.5.9" +version = "3.7.10" maxColumn = 120 align.preset = most continuationIndent.defnSite = 2 From 9bcedec20a4fc7adedce8aea4921c05b0c7acfa4 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Wed, 19 Jul 2023 03:01:13 +0000 Subject: [PATCH 14/15] Reformat with scalafmt 3.7.10 Executed command: scalafmt --non-interactive --- .../src/main/scala-2/zio/sql/macros/insertlike.scala | 2 +- .../src/main/scala-3/zio/sql/macros/groupbylike.scala | 7 +++---- .../src/main/scala-3/zio/sql/macros/havinglike.scala | 7 ++++--- .../src/main/scala-3/zio/sql/macros/insertlike.scala | 2 +- .../src/main/scala-3/zio/sql/macros/normalizer.scala | 3 +-- .../src/main/scala-3/zio/sql/macros/notliteral.scala | 11 +++++------ .../src/main/scala-3/zio/sql/macros/tablelike.scala | 3 +-- .../src/main/scala-3/zio/sql/macros/wherelike.scala | 6 +++--- 8 files changed, 19 insertions(+), 22 deletions(-) diff --git a/macros/src/main/scala-2/zio/sql/macros/insertlike.scala b/macros/src/main/scala-2/zio/sql/macros/insertlike.scala index 8b510afdb..b8ead35c8 100644 --- a/macros/src/main/scala-2/zio/sql/macros/insertlike.scala +++ b/macros/src/main/scala-2/zio/sql/macros/insertlike.scala @@ -26,7 +26,7 @@ object InsertLike { F, ColsRepr, AllColumnIdentities, - Z, + Z ] = macro createInsertLikeImpl[F, ColsRepr, AllColumnIdentities, Z] def createInsertLikeImpl[ diff --git a/macros/src/main/scala-3/zio/sql/macros/groupbylike.scala b/macros/src/main/scala-3/zio/sql/macros/groupbylike.scala index e6d4d65ce..4e02cbced 100644 --- a/macros/src/main/scala-3/zio/sql/macros/groupbylike.scala +++ b/macros/src/main/scala-3/zio/sql/macros/groupbylike.scala @@ -1,11 +1,10 @@ package zio.sql.macros - sealed trait GroupByLike[All, Grouped] object GroupByLike { - final case class CanBeGrouped[All, Grouped]() extends GroupByLike[All, Grouped] + final case class CanBeGrouped[All, Grouped]() extends GroupByLike[All, Grouped] - implicit def createGroupByLike[All, Grouped]: GroupByLike[All, Grouped] = CanBeGrouped[All, Grouped]() -} \ No newline at end of file + implicit def createGroupByLike[All, Grouped]: GroupByLike[All, Grouped] = CanBeGrouped[All, Grouped]() +} diff --git a/macros/src/main/scala-3/zio/sql/macros/havinglike.scala b/macros/src/main/scala-3/zio/sql/macros/havinglike.scala index d3d410889..c8cf4e8b1 100644 --- a/macros/src/main/scala-3/zio/sql/macros/havinglike.scala +++ b/macros/src/main/scala-3/zio/sql/macros/havinglike.scala @@ -1,4 +1,4 @@ -package zio.sql.macros +package zio.sql.macros sealed trait HavingIsSound[AllF, GroupByF, HavingF] @@ -6,6 +6,7 @@ object HavingIsSound { final case class HavingCanBeCalled[AllF, GroupByF, HavingF]() extends HavingIsSound[AllF, GroupByF, HavingF] - implicit def materializeHavingIsSound[AllF, GroupByF, HavingF]: HavingIsSound[AllF, GroupByF, HavingF] = HavingCanBeCalled[AllF, GroupByF, HavingF]() + implicit def materializeHavingIsSound[AllF, GroupByF, HavingF]: HavingIsSound[AllF, GroupByF, HavingF] = + HavingCanBeCalled[AllF, GroupByF, HavingF]() -} \ No newline at end of file +} diff --git a/macros/src/main/scala-3/zio/sql/macros/insertlike.scala b/macros/src/main/scala-3/zio/sql/macros/insertlike.scala index f8795952a..eff5ca575 100644 --- a/macros/src/main/scala-3/zio/sql/macros/insertlike.scala +++ b/macros/src/main/scala-3/zio/sql/macros/insertlike.scala @@ -16,6 +16,6 @@ object InsertLike { F, ColsRepr, AllColumnIdentities, - Z, + Z ] = CanBeInserted[F, ColsRepr, AllColumnIdentities, Z]() } diff --git a/macros/src/main/scala-3/zio/sql/macros/normalizer.scala b/macros/src/main/scala-3/zio/sql/macros/normalizer.scala index a0390a141..3b30d3be1 100644 --- a/macros/src/main/scala-3/zio/sql/macros/normalizer.scala +++ b/macros/src/main/scala-3/zio/sql/macros/normalizer.scala @@ -13,8 +13,7 @@ object Normalizer { // override type Out = Out2 // } - implicit def createNormalizer[In]: Normalizer[In] = { + implicit def createNormalizer[In]: Normalizer[In] = new Normalizer[In] {} - } } diff --git a/macros/src/main/scala-3/zio/sql/macros/notliteral.scala b/macros/src/main/scala-3/zio/sql/macros/notliteral.scala index 4d7bc1197..219b881ef 100644 --- a/macros/src/main/scala-3/zio/sql/macros/notliteral.scala +++ b/macros/src/main/scala-3/zio/sql/macros/notliteral.scala @@ -1,12 +1,11 @@ -package zio.sql.macros +package zio.sql.macros sealed trait IsNotLiteral[F] object IsNotLiteral { - final case class FIsNotLiteral[F]() extends IsNotLiteral[F] + final case class FIsNotLiteral[F]() extends IsNotLiteral[F] - implicit def materializeIsNotLiteral[F]: IsNotLiteral[F] = { - FIsNotLiteral[F]() - } -} \ No newline at end of file + implicit def materializeIsNotLiteral[F]: IsNotLiteral[F] = + FIsNotLiteral[F]() +} diff --git a/macros/src/main/scala-3/zio/sql/macros/tablelike.scala b/macros/src/main/scala-3/zio/sql/macros/tablelike.scala index 881bb52de..3d9a05ed9 100644 --- a/macros/src/main/scala-3/zio/sql/macros/tablelike.scala +++ b/macros/src/main/scala-3/zio/sql/macros/tablelike.scala @@ -6,7 +6,6 @@ object TableSchema { final case class Compatible[T]() extends TableSchema[T] - implicit def materializeTableSchema[T]: TableSchema[T] = Compatible[T]() -} \ No newline at end of file +} diff --git a/macros/src/main/scala-3/zio/sql/macros/wherelike.scala b/macros/src/main/scala-3/zio/sql/macros/wherelike.scala index c6ce1fc3c..474b5aae4 100644 --- a/macros/src/main/scala-3/zio/sql/macros/wherelike.scala +++ b/macros/src/main/scala-3/zio/sql/macros/wherelike.scala @@ -1,10 +1,10 @@ -package zio.sql.macros +package zio.sql.macros sealed trait WhereIsSound[WhereF, GroupByF] object WhereIsSound { final case class WhereCanBeCalled[WhereF, GroupByF]() extends WhereIsSound[WhereF, GroupByF] - implicit def materializeWhereIsSound[WhereF, GroupByF]: WhereIsSound[WhereF, GroupByF] = + implicit def materializeWhereIsSound[WhereF, GroupByF]: WhereIsSound[WhereF, GroupByF] = WhereCanBeCalled[WhereF, GroupByF]() -} \ No newline at end of file +} From 5deeb11b8ed185b64839f67d4babb5c84bf7f2fe Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Wed, 19 Jul 2023 03:01:13 +0000 Subject: [PATCH 15/15] Add 'Reformat with scalafmt 3.7.10' to .git-blame-ignore-revs --- .git-blame-ignore-revs | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .git-blame-ignore-revs diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 000000000..ad60c8cd0 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# Scala Steward: Reformat with scalafmt 3.7.10 +9bcedec20a4fc7adedce8aea4921c05b0c7acfa4