From 806d15559328643f8041347f3590d32669f4e832 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sat, 25 Mar 2023 01:18:04 +0000 Subject: [PATCH 01/38] Update logback-classic to 1.2.12 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 181702c5b..284cd3d3f 100644 --- a/build.sbt +++ b/build.sbt @@ -27,7 +27,7 @@ val zioVersion = "2.0.6" val zioSchemaVersion = "0.4.2" val testcontainersVersion = "1.17.6" val testcontainersScalaVersion = "0.40.11" -val logbackVersion = "1.2.11" +val logbackVersion = "1.2.12" lazy val root = project .in(file(".")) From 0b9e58588052bab6898a2d90f09e24077bf40fac Mon Sep 17 00:00:00 2001 From: Hannes Bibel Date: Sat, 8 Apr 2023 10:03:41 +0200 Subject: [PATCH 02/38] #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 e690a0c9c822ca1592528c5a196dafa2f467da26 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sat, 6 May 2023 06:20:14 +0000 Subject: [PATCH 03/38] Update sbt-ci-release to 1.5.12 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index c81f8d2b7..af7d1f1d8 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -5,7 +5,7 @@ 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("com.github.sbt" % "sbt-ci-release" % "1.5.9") +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.2.16") addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.1") addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.4.2") From a87ccfd4aabe1789a7c75cd0f101fd0bb36eb7b1 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sun, 28 May 2023 09:36:13 +0000 Subject: [PATCH 04/38] Update sbt to 1.8.3 --- mysql/project/build.properties | 2 +- project/build.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql/project/build.properties b/mysql/project/build.properties index 46e43a97e..72413de15 100644 --- a/mysql/project/build.properties +++ b/mysql/project/build.properties @@ -1 +1 @@ -sbt.version=1.8.2 +sbt.version=1.8.3 diff --git a/project/build.properties b/project/build.properties index 46e43a97e..72413de15 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.8.2 +sbt.version=1.8.3 From 6fee7cb3bc6967f07c3f6483500efc1af921e67d Mon Sep 17 00:00:00 2001 From: Dmitry Podpryatov Date: Tue, 30 May 2023 18:52:28 +0300 Subject: [PATCH 05/38] Update docs --- README.md | 51 ++++++++++++++++++++++++++++++++------------------- docs/index.md | 41 +++++++++++++++++++++++++++-------------- 2 files changed, 59 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 39e8e3497..dc084e574 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ZIO SQL lets you write type-safe, type-inferred, and composable SQL queries in ordinary Scala, helping you prevent persistence bugs before they happen, and leverage your IDE to make writing SQL productive, safe, and fun. -[![Development](https://img.shields.io/badge/Project%20Stage-Development-green.svg)](https://github.com/zio/zio/wiki/Project-Stages) ![CI Badge](https://github.com/zio/zio-sql/workflows/CI/badge.svg) [![Sonatype Releases](https://img.shields.io/nexus/r/https/oss.sonatype.org/dev.zio/zio-sql_2.13.svg?label=Sonatype%20Release)](https://oss.sonatype.org/content/repositories/releases/dev/zio/zio-sql_2.13/) [![Sonatype Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-sql_2.13.svg?label=Sonatype%20Snapshot)](https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-sql_2.13/) [![javadoc](https://javadoc.io/badge2/dev.zio/zio-sql-docs_2.13/javadoc.svg)](https://javadoc.io/doc/dev.zio/zio-sql-docs_2.13) [![ZIO SQL](https://img.shields.io/github/stars/zio/zio-sql?style=social)](https://github.com/zio/zio-sql) +[![Development](https://img.shields.io/badge/Project%20Stage-Development-green.svg)](https://github.com/zio/zio/wiki/Project-Stages) ![CI Badge](https://github.com/zio/zio-sql/workflows/CI/badge.svg) [![Sonatype Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-sql_2.13.svg?label=Sonatype%20Snapshot)](https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-sql_2.13/) [![ZIO SQL](https://img.shields.io/github/stars/zio/zio-sql?style=social)](https://github.com/zio/zio-sql) ## Introduction @@ -63,16 +63,16 @@ ZIO SQL is packaged into separate modules for different databases. Depending on ```scala //PostgreSQL -libraryDependencies += "dev.zio" %% "zio-sql-postgres" % "0.1.2" +libraryDependencies += "dev.zio" %% "zio-sql-postgres" % "" //MySQL -libraryDependencies += "dev.zio" %% "zio-sql-mysql" % "0.1.2" +libraryDependencies += "dev.zio" %% "zio-sql-mysql" % "" //Oracle -libraryDependencies += "dev.zio" %% "zio-sql-oracle" % "0.1.2" +libraryDependencies += "dev.zio" %% "zio-sql-oracle" % "" //SQL Server -libraryDependencies += "dev.zio" %% "zio-sql-sqlserver" % "0.1.2" +libraryDependencies += "dev.zio" %% "zio-sql-sqlserver" % "" ``` ## Imports and modules @@ -106,9 +106,12 @@ Values that will represent tables in DSL are then created by calling `defineTabl In order for `defineTable` to work, user need to provide implicit `Schema` of data type. ```scala -import java.util.UUID +import zio.schema.DeriveSchema import zio.sql.postgresql.PostgresJdbcModule +import zio.sql.table.Table._ + import java.time._ +import java.util.UUID object Repository extends PostgresJdbcModule { final case class Product(id: UUID, name: String, price: BigDecimal) @@ -140,7 +143,7 @@ Using the previous example with `Product` and `Order` table ```scala val (id, name, price) = products.columns -val (orderId, productId, quantity) = orders.columns +val (orderId, productId, quantity, date) = orders.columns ``` ## Selects @@ -148,35 +151,35 @@ val (orderId, productId, quantity) = orders.columns Simple select. ```scala -val allProducts = select(productId, name, price).from(products) +val allProducts = select(id, name, price).from(products) ``` Using `where` clause. ```scala -def productById(id: UUID) = - select(productId, name, price).from(products).where(productId === id) +def productById(uuid: UUID) = + select(id, name, price).from(products).where(id === uuid) ``` Inner join. ```scala val ordersWithProductNames = - select(orderId, name).from(products.join(orders).on(productId === fkProductId)) + select(orderId, name).from(products.join(orders).on(productId === id)) ``` Left outer join. ```scala val leftOuter = - select(orderId, name).from(products.leftOuter(orders).on(productId === fkProductId)) + select(orderId, name).from(products.leftOuter(orders).on(productId === id)) ``` Right outer join. ```scala val rightOuter = - select(orderId, name).from(products.rightOuter(orders).on(productId === fkProductId)) + select(orderId, name).from(products.rightOuter(orders).on(productId === id)) ``` Using `limit` and `offset` @@ -185,7 +188,7 @@ Using `limit` and `offset` val limitedResults = select(orderId, name) .from(products.join(orders) - .on(productId === fkProductId)) + .on(productId === id)) .limit(5) .offset(10) ``` @@ -193,18 +196,28 @@ val limitedResults = ## Inserts ```scala -insertInto(products) - (productId, name, price) - .values((UUID.randomUUID(), "Zionomicon", 10.5)) +def insertProduct(uuid: UUID) = + insertInto(products)(id, name, price) + .values((uuid, "Zionomicon", 10.5)) ``` ## Updates -TODO: details +```scala +def updateProduct(uuid: UUID) = + update(products) + .set(name, "foo") + .set(price, price * 1.1) + .where(id === uuid) +``` ## Deletes -TODO: details +```scala +def deleteProduct(uuid: UUID) = + deleteFrom(products) + .where(id === uuid) +``` ## Transactions diff --git a/docs/index.md b/docs/index.md index b1a90580b..d3a940504 100644 --- a/docs/index.md +++ b/docs/index.md @@ -106,9 +106,12 @@ Values that will represent tables in DSL are then created by calling `defineTabl In order for `defineTable` to work, user need to provide implicit `Schema` of data type. ```scala -import java.util.UUID +import zio.schema.DeriveSchema import zio.sql.postgresql.PostgresJdbcModule +import zio.sql.table.Table._ + import java.time._ +import java.util.UUID object Repository extends PostgresJdbcModule { final case class Product(id: UUID, name: String, price: BigDecimal) @@ -140,7 +143,7 @@ Using the previous example with `Product` and `Order` table ```scala val (id, name, price) = products.columns -val (orderId, productId, quantity) = orders.columns +val (orderId, productId, quantity, date) = orders.columns ``` ## Selects @@ -148,35 +151,35 @@ val (orderId, productId, quantity) = orders.columns Simple select. ```scala -val allProducts = select(productId, name, price).from(products) +val allProducts = select(id, name, price).from(products) ``` Using `where` clause. ```scala -def productById(id: UUID) = - select(productId, name, price).from(products).where(productId === id) +def productById(uuid: UUID) = + select(id, name, price).from(products).where(id === uuid) ``` Inner join. ```scala val ordersWithProductNames = - select(orderId, name).from(products.join(orders).on(productId === fkProductId)) + select(orderId, name).from(products.join(orders).on(productId === id)) ``` Left outer join. ```scala val leftOuter = - select(orderId, name).from(products.leftOuter(orders).on(productId === fkProductId)) + select(orderId, name).from(products.leftOuter(orders).on(productId === id)) ``` Right outer join. ```scala val rightOuter = - select(orderId, name).from(products.rightOuter(orders).on(productId === fkProductId)) + select(orderId, name).from(products.rightOuter(orders).on(productId === id)) ``` Using `limit` and `offset` @@ -185,7 +188,7 @@ Using `limit` and `offset` val limitedResults = select(orderId, name) .from(products.join(orders) - .on(productId === fkProductId)) + .on(productId === id)) .limit(5) .offset(10) ``` @@ -193,18 +196,28 @@ val limitedResults = ## Inserts ```scala -insertInto(products) - (productId, name, price) - .values((UUID.randomUUID(), "Zionomicon", 10.5)) +def insertProduct(uuid: UUID) = + insertInto(products)(id, name, price) + .values((uuid, "Zionomicon", 10.5)) ``` ## Updates -TODO: details +```scala +def updateProduct(uuid: UUID) = + update(products) + .set(name, "foo") + .set(price, price * 1.1) + .where(id === uuid) +``` ## Deletes -TODO: details +```scala +def deleteProduct(uuid: UUID) = + deleteFrom(products) + .where(id === uuid) +``` ## Transactions From eb42ea773aa04448c294355ad93d6342dc215342 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Thu, 1 Jun 2023 08:34:59 +0000 Subject: [PATCH 06/38] Update database-commons, jdbc, mssqlserver, ... to 1.18.3 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 8bb85226d..243831c25 100644 --- a/build.sbt +++ b/build.sbt @@ -25,7 +25,7 @@ addCommandAlias("check", "all scalafmtSbtCheck scalafmtCheck test:scalafmtCheck" val zioVersion = "2.0.6" val zioSchemaVersion = "0.4.2" -val testcontainersVersion = "1.17.6" +val testcontainersVersion = "1.18.3" val testcontainersScalaVersion = "0.40.11" val logbackVersion = "1.2.11" From 1b7dbecf42b12dd24f30bec419a4520a627f83a2 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sat, 3 Jun 2023 11:03:18 +0000 Subject: [PATCH 07/38] Update sbt-scoverage to 2.0.8 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index c81f8d2b7..45490d787 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -3,7 +3,7 @@ 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") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.6") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.8") addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.3") addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.9") addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.2.16") From 3bbcc08eb3344b02984b2e569fbd6fae327c1549 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Mon, 5 Jun 2023 11:54:41 +0000 Subject: [PATCH 08/38] Update sbt-scalafix to 0.11.0 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index c81f8d2b7..dfffc3e31 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -7,6 +7,6 @@ addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.6" addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.3") 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") +addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.0") addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.4.2") addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.3.10") From 652d5a3d5e7e975f84df6553b48e948230e57977 Mon Sep 17 00:00:00 2001 From: Dan Aharon Date: Tue, 30 May 2023 20:06:39 -0700 Subject: [PATCH 09/38] 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 10/38] 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 11/38] 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 12/38] 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 13/38] 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 14/38] 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 15/38] 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 6eb1da6d1eb0ca105e77f130829f443bc1013d5f Mon Sep 17 00:00:00 2001 From: Dmitry Podpryatov Date: Tue, 30 May 2023 18:52:28 +0300 Subject: [PATCH 16/38] Update docs --- README.md | 51 ++++++++++++++++++++++++++++++++------------------- docs/index.md | 41 +++++++++++++++++++++++++++-------------- 2 files changed, 59 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 39e8e3497..dc084e574 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ZIO SQL lets you write type-safe, type-inferred, and composable SQL queries in ordinary Scala, helping you prevent persistence bugs before they happen, and leverage your IDE to make writing SQL productive, safe, and fun. -[![Development](https://img.shields.io/badge/Project%20Stage-Development-green.svg)](https://github.com/zio/zio/wiki/Project-Stages) ![CI Badge](https://github.com/zio/zio-sql/workflows/CI/badge.svg) [![Sonatype Releases](https://img.shields.io/nexus/r/https/oss.sonatype.org/dev.zio/zio-sql_2.13.svg?label=Sonatype%20Release)](https://oss.sonatype.org/content/repositories/releases/dev/zio/zio-sql_2.13/) [![Sonatype Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-sql_2.13.svg?label=Sonatype%20Snapshot)](https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-sql_2.13/) [![javadoc](https://javadoc.io/badge2/dev.zio/zio-sql-docs_2.13/javadoc.svg)](https://javadoc.io/doc/dev.zio/zio-sql-docs_2.13) [![ZIO SQL](https://img.shields.io/github/stars/zio/zio-sql?style=social)](https://github.com/zio/zio-sql) +[![Development](https://img.shields.io/badge/Project%20Stage-Development-green.svg)](https://github.com/zio/zio/wiki/Project-Stages) ![CI Badge](https://github.com/zio/zio-sql/workflows/CI/badge.svg) [![Sonatype Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-sql_2.13.svg?label=Sonatype%20Snapshot)](https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-sql_2.13/) [![ZIO SQL](https://img.shields.io/github/stars/zio/zio-sql?style=social)](https://github.com/zio/zio-sql) ## Introduction @@ -63,16 +63,16 @@ ZIO SQL is packaged into separate modules for different databases. Depending on ```scala //PostgreSQL -libraryDependencies += "dev.zio" %% "zio-sql-postgres" % "0.1.2" +libraryDependencies += "dev.zio" %% "zio-sql-postgres" % "" //MySQL -libraryDependencies += "dev.zio" %% "zio-sql-mysql" % "0.1.2" +libraryDependencies += "dev.zio" %% "zio-sql-mysql" % "" //Oracle -libraryDependencies += "dev.zio" %% "zio-sql-oracle" % "0.1.2" +libraryDependencies += "dev.zio" %% "zio-sql-oracle" % "" //SQL Server -libraryDependencies += "dev.zio" %% "zio-sql-sqlserver" % "0.1.2" +libraryDependencies += "dev.zio" %% "zio-sql-sqlserver" % "" ``` ## Imports and modules @@ -106,9 +106,12 @@ Values that will represent tables in DSL are then created by calling `defineTabl In order for `defineTable` to work, user need to provide implicit `Schema` of data type. ```scala -import java.util.UUID +import zio.schema.DeriveSchema import zio.sql.postgresql.PostgresJdbcModule +import zio.sql.table.Table._ + import java.time._ +import java.util.UUID object Repository extends PostgresJdbcModule { final case class Product(id: UUID, name: String, price: BigDecimal) @@ -140,7 +143,7 @@ Using the previous example with `Product` and `Order` table ```scala val (id, name, price) = products.columns -val (orderId, productId, quantity) = orders.columns +val (orderId, productId, quantity, date) = orders.columns ``` ## Selects @@ -148,35 +151,35 @@ val (orderId, productId, quantity) = orders.columns Simple select. ```scala -val allProducts = select(productId, name, price).from(products) +val allProducts = select(id, name, price).from(products) ``` Using `where` clause. ```scala -def productById(id: UUID) = - select(productId, name, price).from(products).where(productId === id) +def productById(uuid: UUID) = + select(id, name, price).from(products).where(id === uuid) ``` Inner join. ```scala val ordersWithProductNames = - select(orderId, name).from(products.join(orders).on(productId === fkProductId)) + select(orderId, name).from(products.join(orders).on(productId === id)) ``` Left outer join. ```scala val leftOuter = - select(orderId, name).from(products.leftOuter(orders).on(productId === fkProductId)) + select(orderId, name).from(products.leftOuter(orders).on(productId === id)) ``` Right outer join. ```scala val rightOuter = - select(orderId, name).from(products.rightOuter(orders).on(productId === fkProductId)) + select(orderId, name).from(products.rightOuter(orders).on(productId === id)) ``` Using `limit` and `offset` @@ -185,7 +188,7 @@ Using `limit` and `offset` val limitedResults = select(orderId, name) .from(products.join(orders) - .on(productId === fkProductId)) + .on(productId === id)) .limit(5) .offset(10) ``` @@ -193,18 +196,28 @@ val limitedResults = ## Inserts ```scala -insertInto(products) - (productId, name, price) - .values((UUID.randomUUID(), "Zionomicon", 10.5)) +def insertProduct(uuid: UUID) = + insertInto(products)(id, name, price) + .values((uuid, "Zionomicon", 10.5)) ``` ## Updates -TODO: details +```scala +def updateProduct(uuid: UUID) = + update(products) + .set(name, "foo") + .set(price, price * 1.1) + .where(id === uuid) +``` ## Deletes -TODO: details +```scala +def deleteProduct(uuid: UUID) = + deleteFrom(products) + .where(id === uuid) +``` ## Transactions diff --git a/docs/index.md b/docs/index.md index b1a90580b..d3a940504 100644 --- a/docs/index.md +++ b/docs/index.md @@ -106,9 +106,12 @@ Values that will represent tables in DSL are then created by calling `defineTabl In order for `defineTable` to work, user need to provide implicit `Schema` of data type. ```scala -import java.util.UUID +import zio.schema.DeriveSchema import zio.sql.postgresql.PostgresJdbcModule +import zio.sql.table.Table._ + import java.time._ +import java.util.UUID object Repository extends PostgresJdbcModule { final case class Product(id: UUID, name: String, price: BigDecimal) @@ -140,7 +143,7 @@ Using the previous example with `Product` and `Order` table ```scala val (id, name, price) = products.columns -val (orderId, productId, quantity) = orders.columns +val (orderId, productId, quantity, date) = orders.columns ``` ## Selects @@ -148,35 +151,35 @@ val (orderId, productId, quantity) = orders.columns Simple select. ```scala -val allProducts = select(productId, name, price).from(products) +val allProducts = select(id, name, price).from(products) ``` Using `where` clause. ```scala -def productById(id: UUID) = - select(productId, name, price).from(products).where(productId === id) +def productById(uuid: UUID) = + select(id, name, price).from(products).where(id === uuid) ``` Inner join. ```scala val ordersWithProductNames = - select(orderId, name).from(products.join(orders).on(productId === fkProductId)) + select(orderId, name).from(products.join(orders).on(productId === id)) ``` Left outer join. ```scala val leftOuter = - select(orderId, name).from(products.leftOuter(orders).on(productId === fkProductId)) + select(orderId, name).from(products.leftOuter(orders).on(productId === id)) ``` Right outer join. ```scala val rightOuter = - select(orderId, name).from(products.rightOuter(orders).on(productId === fkProductId)) + select(orderId, name).from(products.rightOuter(orders).on(productId === id)) ``` Using `limit` and `offset` @@ -185,7 +188,7 @@ Using `limit` and `offset` val limitedResults = select(orderId, name) .from(products.join(orders) - .on(productId === fkProductId)) + .on(productId === id)) .limit(5) .offset(10) ``` @@ -193,18 +196,28 @@ val limitedResults = ## Inserts ```scala -insertInto(products) - (productId, name, price) - .values((UUID.randomUUID(), "Zionomicon", 10.5)) +def insertProduct(uuid: UUID) = + insertInto(products)(id, name, price) + .values((uuid, "Zionomicon", 10.5)) ``` ## Updates -TODO: details +```scala +def updateProduct(uuid: UUID) = + update(products) + .set(name, "foo") + .set(price, price * 1.1) + .where(id === uuid) +``` ## Deletes -TODO: details +```scala +def deleteProduct(uuid: UUID) = + deleteFrom(products) + .where(id === uuid) +``` ## Transactions From e89697fcac8645598153f6e574616657d31e434a Mon Sep 17 00:00:00 2001 From: DmitryPodpryatov Date: Tue, 13 Jun 2023 19:40:23 +0300 Subject: [PATCH 17/38] generate new readme --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index dc084e574..607e01e75 100644 --- a/README.md +++ b/README.md @@ -63,16 +63,16 @@ ZIO SQL is packaged into separate modules for different databases. Depending on ```scala //PostgreSQL -libraryDependencies += "dev.zio" %% "zio-sql-postgres" % "" +libraryDependencies += "dev.zio" %% "zio-sql-postgres" % "0.0.0+1567-6379510e-SNAPSHOT" //MySQL -libraryDependencies += "dev.zio" %% "zio-sql-mysql" % "" +libraryDependencies += "dev.zio" %% "zio-sql-mysql" % "0.0.0+1567-6379510e-SNAPSHOT" //Oracle -libraryDependencies += "dev.zio" %% "zio-sql-oracle" % "" +libraryDependencies += "dev.zio" %% "zio-sql-oracle" % "0.0.0+1567-6379510e-SNAPSHOT" //SQL Server -libraryDependencies += "dev.zio" %% "zio-sql-sqlserver" % "" +libraryDependencies += "dev.zio" %% "zio-sql-sqlserver" % "0.0.0+1567-6379510e-SNAPSHOT" ``` ## Imports and modules From b56e51832fb3887e228eb68a622674d19ff9bb69 Mon Sep 17 00:00:00 2001 From: DmitryPodpryatov Date: Wed, 14 Jun 2023 16:17:46 +0300 Subject: [PATCH 18/38] generate new readme --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 607e01e75..e4f545e0b 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ZIO SQL lets you write type-safe, type-inferred, and composable SQL queries in ordinary Scala, helping you prevent persistence bugs before they happen, and leverage your IDE to make writing SQL productive, safe, and fun. -[![Development](https://img.shields.io/badge/Project%20Stage-Development-green.svg)](https://github.com/zio/zio/wiki/Project-Stages) ![CI Badge](https://github.com/zio/zio-sql/workflows/CI/badge.svg) [![Sonatype Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-sql_2.13.svg?label=Sonatype%20Snapshot)](https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-sql_2.13/) [![ZIO SQL](https://img.shields.io/github/stars/zio/zio-sql?style=social)](https://github.com/zio/zio-sql) +[![Development](https://img.shields.io/badge/Project%20Stage-Development-green.svg)](https://github.com/zio/zio/wiki/Project-Stages) ![CI Badge](https://github.com/zio/zio-sql/workflows/CI/badge.svg) [![Sonatype Releases](https://img.shields.io/nexus/r/https/oss.sonatype.org/dev.zio/zio-sql_2.13.svg?label=Sonatype%20Release)](https://oss.sonatype.org/content/repositories/releases/dev/zio/zio-sql_2.13/) [![Sonatype Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-sql_2.13.svg?label=Sonatype%20Snapshot)](https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-sql_2.13/) [![javadoc](https://javadoc.io/badge2/dev.zio/zio-sql-docs_2.13/javadoc.svg)](https://javadoc.io/doc/dev.zio/zio-sql-docs_2.13) [![ZIO SQL](https://img.shields.io/github/stars/zio/zio-sql?style=social)](https://github.com/zio/zio-sql) ## Introduction @@ -63,16 +63,16 @@ ZIO SQL is packaged into separate modules for different databases. Depending on ```scala //PostgreSQL -libraryDependencies += "dev.zio" %% "zio-sql-postgres" % "0.0.0+1567-6379510e-SNAPSHOT" +libraryDependencies += "dev.zio" %% "zio-sql-postgres" % "0.1.2" //MySQL -libraryDependencies += "dev.zio" %% "zio-sql-mysql" % "0.0.0+1567-6379510e-SNAPSHOT" +libraryDependencies += "dev.zio" %% "zio-sql-mysql" % "0.1.2" //Oracle -libraryDependencies += "dev.zio" %% "zio-sql-oracle" % "0.0.0+1567-6379510e-SNAPSHOT" +libraryDependencies += "dev.zio" %% "zio-sql-oracle" % "0.1.2" //SQL Server -libraryDependencies += "dev.zio" %% "zio-sql-sqlserver" % "0.0.0+1567-6379510e-SNAPSHOT" +libraryDependencies += "dev.zio" %% "zio-sql-sqlserver" % "0.1.2" ``` ## Imports and modules From f55613cdb1b318d5c9c8bb67da0da6b574381440 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sun, 18 Jun 2023 22:41:51 +0000 Subject: [PATCH 19/38] 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 20/38] 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 21/38] 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 c024ba57e7e3e5b0a4e596b3590fbb782f5bbb05 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Thu, 13 Jul 2023 07:27:19 +0000 Subject: [PATCH 22/38] Update sbt-tpolecat to 0.4.4 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index c81f8d2b7..cca24ba0a 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -8,5 +8,5 @@ addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.3" 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") -addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.4.2") +addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.4.4") addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.3.10") From a027817eeda323403ff2a9dbb92633e00d15943e Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Wed, 19 Jul 2023 03:00:38 +0000 Subject: [PATCH 23/38] 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 24/38] 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 25/38] 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 26/38] 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 From 46e4ca7264956563989d1dbe40c3dafb41b2c76b Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Tue, 25 Jul 2023 05:54:34 +0000 Subject: [PATCH 27/38] Revert commit(s) 806d155 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 284cd3d3f..181702c5b 100644 --- a/build.sbt +++ b/build.sbt @@ -27,7 +27,7 @@ val zioVersion = "2.0.6" val zioSchemaVersion = "0.4.2" val testcontainersVersion = "1.17.6" val testcontainersScalaVersion = "0.40.11" -val logbackVersion = "1.2.12" +val logbackVersion = "1.2.11" lazy val root = project .in(file(".")) From bc2889e7bd209fbd985eaff95490b27f6efcf8c3 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Tue, 25 Jul 2023 05:54:46 +0000 Subject: [PATCH 28/38] Update logback-classic to 1.2.12 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 8f2d2afc9..ab198ee32 100644 --- a/build.sbt +++ b/build.sbt @@ -27,7 +27,7 @@ val zioVersion = "2.0.6" val zioSchemaVersion = "0.4.2" val testcontainersVersion = "1.17.6" val testcontainersScalaVersion = "0.40.17" -val logbackVersion = "1.2.11" +val logbackVersion = "1.2.12" lazy val root = project .in(file(".")) From 01f732be2de11c5535f506d021d7a3afeb75b325 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Thu, 27 Jul 2023 02:42:22 +0000 Subject: [PATCH 29/38] Update silencer-lib, silencer-plugin to 1.17.13 --- project/BuildHelper.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/BuildHelper.scala b/project/BuildHelper.scala index e0f22bc6f..351e0fcae 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.13" + val SilencerVersion = "1.17.13" val Scala212 = "2.12.17" val Scala213 = "2.13.10" val ScalaDotty = "3.2.1" From 5ad1914eb6125aecaf3f318a5733f976cfbf2395 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Thu, 27 Jul 2023 02:42:34 +0000 Subject: [PATCH 30/38] Revert commit(s) e690a0c --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index af7d1f1d8..c81f8d2b7 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -5,7 +5,7 @@ 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("com.github.sbt" % "sbt-ci-release" % "1.5.12") +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") addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.4.2") From 94ab1954d2c04e8ba7ea3b0e98cc734f24620084 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Thu, 27 Jul 2023 02:42:42 +0000 Subject: [PATCH 31/38] Update sbt-ci-release to 1.5.12 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 036c889c9..3af9a33d3 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -5,7 +5,7 @@ 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.9") -addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.9") +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.2.16") addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.1") addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.4.2") From 4a2336aadea904740bc763a46548409c7702148a Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Thu, 27 Jul 2023 02:43:35 +0000 Subject: [PATCH 32/38] Update sbt to 1.9.3 --- mysql/project/build.properties | 2 +- project/build.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql/project/build.properties b/mysql/project/build.properties index 72413de15..52413ab79 100644 --- a/mysql/project/build.properties +++ b/mysql/project/build.properties @@ -1 +1 @@ -sbt.version=1.8.3 +sbt.version=1.9.3 diff --git a/project/build.properties b/project/build.properties index 72413de15..52413ab79 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.8.3 +sbt.version=1.9.3 From 3014aab270eb0e5b8c28dca10e3325d414b429b0 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Thu, 27 Jul 2023 02:43:48 +0000 Subject: [PATCH 33/38] Update scalafmt-core to 3.7.11 --- .scalafmt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index 6c4a46c56..342a5dd24 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = "3.7.10" +version = "3.7.11" maxColumn = 120 align.preset = most continuationIndent.defnSite = 2 From 9f7af8a8cc5e8e99a2f0b2a64be001076a051b7f Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Thu, 27 Jul 2023 02:44:16 +0000 Subject: [PATCH 34/38] Revert commit(s) 1b7dbec --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 45490d787..c81f8d2b7 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -3,7 +3,7 @@ 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") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.8") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.6") addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.3") addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.9") addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.2.16") From 731b82ed88524b1d7e726f11d32972e051edc2f7 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Thu, 27 Jul 2023 02:44:24 +0000 Subject: [PATCH 35/38] Update sbt-scoverage to 2.0.8 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 036c889c9..a19e47132 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -3,7 +3,7 @@ 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") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.6") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.8") 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") From 18c40b00bc95527684dc5e5c28c6813bb8ab1bd3 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Thu, 27 Jul 2023 02:44:38 +0000 Subject: [PATCH 36/38] Revert commit(s) eb42ea7 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 243831c25..8bb85226d 100644 --- a/build.sbt +++ b/build.sbt @@ -25,7 +25,7 @@ addCommandAlias("check", "all scalafmtSbtCheck scalafmtCheck test:scalafmtCheck" val zioVersion = "2.0.6" val zioSchemaVersion = "0.4.2" -val testcontainersVersion = "1.18.3" +val testcontainersVersion = "1.17.6" val testcontainersScalaVersion = "0.40.11" val logbackVersion = "1.2.11" From e097c853c972c55bee418379fad274b4c6e1dcef Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Thu, 27 Jul 2023 02:44:47 +0000 Subject: [PATCH 37/38] Update database-commons, jdbc, mssqlserver, ... to 1.18.3 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 8f2d2afc9..0cae8b5f1 100644 --- a/build.sbt +++ b/build.sbt @@ -25,7 +25,7 @@ addCommandAlias("check", "all scalafmtSbtCheck scalafmtCheck test:scalafmtCheck" val zioVersion = "2.0.6" val zioSchemaVersion = "0.4.2" -val testcontainersVersion = "1.17.6" +val testcontainersVersion = "1.18.3" val testcontainersScalaVersion = "0.40.17" val logbackVersion = "1.2.11" From 3e20ffadbf47ed605f5254d3f7333fbe1d02f2a6 Mon Sep 17 00:00:00 2001 From: jczuchnowski Date: Thu, 27 Jul 2023 12:27:21 +0200 Subject: [PATCH 38/38] Update versions --- .github/workflows/ci.yml | 2 +- build.sbt | 6 +++--- project/BuildHelper.scala | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc3d8dd8d..ac38c1366 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: fail-fast: false matrix: java: ['adopt@1.8', 'adopt@1.11'] - scala: ['2.12.17', '2.13.10'] + scala: ['2.12.18', '2.13.10'] steps: - name: Checkout current branch uses: actions/checkout@v2.3.4 diff --git a/build.sbt b/build.sbt index 2a8cf0dad..8cb9c984d 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.6" -val zioSchemaVersion = "0.4.2" +val zioVersion = "2.0.15" +val zioSchemaVersion = "0.4.13" val testcontainersVersion = "1.18.3" val testcontainersScalaVersion = "0.40.17" -val logbackVersion = "1.2.12" +val logbackVersion = "1.3.8" lazy val root = project .in(file(".")) diff --git a/project/BuildHelper.scala b/project/BuildHelper.scala index 351e0fcae..fa55096d4 100644 --- a/project/BuildHelper.scala +++ b/project/BuildHelper.scala @@ -10,9 +10,9 @@ import scalafix.sbt.ScalafixPlugin.autoImport.scalafixSemanticdb object BuildHelper { val SilencerVersion = "1.17.13" - val Scala212 = "2.12.17" + val Scala212 = "2.12.18" val Scala213 = "2.13.10" - val ScalaDotty = "3.2.1" + val ScalaDotty = "3.3.0" def buildInfoSettings(packageName: String) = Seq(