diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 741775cc0c..1f5a7149a7 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,2 +1,5 @@ # Scala Steward: Reformat with scalafmt 3.7.5 d8a77dfb017feae820e38eea0d7b5128b13a737d + +# Scala Steward: Reformat with scalafmt 3.8.3 +1b7c658737faa53ec506fb403892320773282488 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 903a559966..339b13c2cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: key: ${{ runner.os }}-${{matrix.scala}}-${{matrix.module}}-${{ hashFiles('**/build.sbt') }} - name: Setup Java - uses: actions/setup-java@v3.12.0 + uses: actions/setup-java@v4.2.2 with: distribution: temurin java-version: '17' @@ -87,7 +87,7 @@ jobs: key: ${{ runner.os }}-${{matrix.scala}}-${{matrix.module}}-${{ hashFiles('**/build.sbt') }} - name: Setup Java - uses: actions/setup-java@v3.12.0 + uses: actions/setup-java@v4.2.2 with: distribution: temurin java-version: '17' @@ -110,7 +110,7 @@ jobs: steps: - uses: actions/checkout@v4.0.0 - name: Setup Java - uses: actions/setup-java@v3.12.0 + uses: actions/setup-java@v4.2.2 with: distribution: temurin java-version: '11' diff --git a/.github/workflows/scala-steward.yml b/.github/workflows/scala-steward.yml index dccdd041db..8a53069ad3 100644 --- a/.github/workflows/scala-steward.yml +++ b/.github/workflows/scala-steward.yml @@ -13,7 +13,7 @@ jobs: name: Scala Steward steps: - name: Scala Steward - uses: scala-steward-org/scala-steward-action@v2.65.0 + uses: scala-steward-org/scala-steward-action@v2.69.0 with: github-app-id: ${{ secrets.SCALA_STEWARD_GITHUB_APP_ID }} github-app-installation-id: ${{ secrets.SCALA_STEWARD_GITHUB_APP_INSTALLATION_ID }} diff --git a/.scalafmt.conf b/.scalafmt.conf index cab60eea10..245e90a2c6 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = "3.8.2" +version = "3.8.3" maxColumn = 240 align.preset = most align.multiline = false diff --git a/build.sbt b/build.sbt index d77b4e4cbd..1514ec6f67 100644 --- a/build.sbt +++ b/build.sbt @@ -164,7 +164,7 @@ lazy val `quill-util` = .settings( Test / fork := true, libraryDependencies ++= Seq( - ("org.scalameta" %% "scalafmt-core" % "3.8.2") + ("org.scalameta" %% "scalafmt-core" % "3.8.3") .excludeAll( ({ if (isScala3) @@ -202,7 +202,7 @@ lazy val `quill-engine` = "com.typesafe" % "config" % "1.4.3", "com.typesafe.scala-logging" %% "scala-logging" % "3.9.5", ("com.github.takayahilton" %% "sql-formatter" % "1.2.1").cross(CrossVersion.for3Use2_13), - "io.suzaku" %% "boopickle" % "1.4.0", + "io.suzaku" %% "boopickle" % "1.5.0", "com.lihaoyi" %% "pprint" % "0.9.0", "com.github.ben-manes.caffeine" % "caffeine" % "3.1.8" ), @@ -216,7 +216,7 @@ lazy val `quill-core` = .settings( libraryDependencies ++= Seq( "com.typesafe" % "config" % "1.4.3", - "dev.zio" %% "zio-logging" % "2.3.0", + "dev.zio" %% "zio-logging" % "2.3.1", "dev.zio" %% "zio" % Version.zio, "dev.zio" %% "zio-streams" % Version.zio, "com.typesafe.scala-logging" %% "scala-logging" % "3.9.5" @@ -422,8 +422,8 @@ lazy val `quill-jdbc-zio` = .settings( libraryDependencies ++= Seq( // Needed for PGObject in JsonExtensions but not necessary if user is not using postgres - "org.postgresql" % "postgresql" % "42.7.3" % "provided", - "dev.zio" %% "zio-json" % "0.7.1" + "org.postgresql" % "postgresql" % "42.7.4" % "provided", + "dev.zio" %% "zio-json" % "0.7.3" ), Test / testGrouping := { (Test / definedTests).value map { test => @@ -510,7 +510,7 @@ lazy val `quill-orientdb` = .settings( Test / fork := true, libraryDependencies ++= Seq( - "com.orientechnologies" % "orientdb-graphdb" % "3.2.31" + "com.orientechnologies" % "orientdb-graphdb" % "3.2.33" ) ) .dependsOn( @@ -533,9 +533,9 @@ lazy val jdbcTestingLibraries = Seq( libraryDependencies ++= Seq( "com.zaxxer" % "HikariCP" % "5.1.0" exclude ("org.slf4j", "*"), "com.mysql" % "mysql-connector-j" % "9.0.0" % Test, - "com.h2database" % "h2" % "2.2.224" % Test, - "org.postgresql" % "postgresql" % "42.7.3" % Test, - "org.xerial" % "sqlite-jdbc" % "3.46.0.0" % Test, + "com.h2database" % "h2" % "2.3.232" % Test, + "org.postgresql" % "postgresql" % "42.7.4" % Test, + "org.xerial" % "sqlite-jdbc" % "3.46.1.0" % Test, "com.microsoft.sqlserver" % "mssql-jdbc" % "7.4.1.jre11" % Test, "com.oracle.ojdbc" % "ojdbc8" % "19.3.0.0" % Test, "org.mockito" %% "mockito-scala-scalatest" % "1.17.14" % Test @@ -597,7 +597,7 @@ def excludePaths(paths: Seq[String]) = { }) } -val scala_v_12 = "2.12.19" +val scala_v_12 = "2.12.20" val scala_v_13 = "2.13.14" val scala_v_30 = "3.3.3" @@ -605,7 +605,7 @@ val scalaCollectionCompatVersion = "2.12.0" lazy val loggingSettings = Seq( libraryDependencies ++= Seq( - "ch.qos.logback" % "logback-classic" % "1.5.6" % Test + "ch.qos.logback" % "logback-classic" % "1.5.8" % Test ) ) diff --git a/build/build.sh b/build/build.sh index 1eea9caf50..d593fed46b 100755 --- a/build/build.sh +++ b/build/build.sh @@ -242,7 +242,7 @@ fi show_mem echo "Tests completed. Shutting down" -time docker-compose down +time docker compose down # for 2.12 publish coverage if [[ $SCALA_VERSION == 2.12* ]]; then echo "Coverage" diff --git a/build/m1/README.MD b/build/m1/README.MD index e30f4064c8..afd1ef7179 100644 --- a/build/m1/README.MD +++ b/build/m1/README.MD @@ -10,27 +10,27 @@ In order to get this project to build on a Mac with an M1 or later chip, you wil ## Setup To get started - be sure to setup the databases needed for the build/test process. Do so by executing the following: -`docker-compose -f docker-compose-m1.yml --rm setup` +`docker compose -f docker-compose-m1.yml --rm setup` -Any time you want to re-setup your databases (i.e. you run `docker-compose down`) - you will need to run that command pointed at the right YAML. +Any time you want to re-setup your databases (i.e. you run `docker compose down`) - you will need to run that command pointed at the right YAML. ## Compile and Test To start the build and run tests, its often best to skip the codegen tests as they can sometimes cause phantom errors. To do this, execute the following: -`docker-compose -f docker-compose-m1.yml run sbt sbt -Dmodules=db test` +`docker compose -f docker-compose-m1.yml run sbt sbt -Dmodules=db test` Drop the `-Dmodules=db` if you want to run ALL the tests (and grab an adult beverage while it runs - it'll be a while). Check out the `build.sbt` for a list of the various modules you can build together or independently. ## Stop Your Services - Don't Down them! -Be nice to your M1 system - stop your services - don't down them. Running `docker-compose -f docker-compose-m1.yml down` will stop AND remove all your services. What this means is the next time you want to run your tests again - you better run setup again or your tests will fail due to missing databases! +Be nice to your M1 system - stop your services - don't down them. Running `docker compose -f docker-compose-m1.yml down` will stop AND remove all your services. What this means is the next time you want to run your tests again - you better run setup again or your tests will fail due to missing databases! -If you plan to have some rapid build/test cycles - run: `docker-compose -f docker-compose-m1.yml stop` to stop your services. It will preserve the volumes that were created when you ran setup. It'll save you a good amount of time. +If you plan to have some rapid build/test cycles - run: `docker compose -f docker-compose-m1.yml stop` to stop your services. It will preserve the volumes that were created when you ran setup. It'll save you a good amount of time. ## Build With a Specific Scala Version By default the build executes with Scala 2.13. Not horrible - but if you want to take advantage of the improved compiler of a more recent 2.x version of Scala you can specify that! You can simply set the `quill.scala.version` when you start your build: -`docker-compose -f docker-compose-m1.yml run sbt sbt -Dquill.scala.version=2.13.6 -Dmodules=db test` +`docker compose -f docker-compose-m1.yml run sbt sbt -Dquill.scala.version=2.13.6 -Dmodules=db test` Check out the [CONTRIBUTING](../../docs/CONTRIBUTING.md) guide for more details. Good luck! \ No newline at end of file diff --git a/build/setup_bigdata.sh b/build/setup_bigdata.sh index ff6bdf7b51..c1cd44df77 100755 --- a/build/setup_bigdata.sh +++ b/build/setup_bigdata.sh @@ -2,7 +2,7 @@ set -e -time docker-compose up -d cassandra orientdb +time docker compose up -d cassandra orientdb # import setup functions . build/setup_db_scripts.sh @@ -10,6 +10,6 @@ time docker-compose up -d cassandra orientdb # setup cassandra in docker send_script cassandra $CASSANDRA_SCRIPT cassandra-schema.cql send_script cassandra ./build/setup_db_scripts.sh setup_db_scripts.sh -time docker-compose exec -T cassandra bash -c ". setup_db_scripts.sh && setup_cassandra 127.0.0.1 cassandra-schema.cql" +time docker compose exec -T cassandra bash -c ". setup_db_scripts.sh && setup_cassandra 127.0.0.1 cassandra-schema.cql" echo "Databases are ready!" \ No newline at end of file diff --git a/build/setup_databases.sh b/build/setup_databases.sh index 68408b2df5..d5f73e33c7 100755 --- a/build/setup_databases.sh +++ b/build/setup_databases.sh @@ -3,10 +3,10 @@ set -e echo "### Bringing Down Any Docker Containers that May Be Running ###" -time docker-compose down --rmi all +time docker compose down --rmi all echo "### Bringing Up sqlserver, oracle, postgres, mysql Images ###" -time docker-compose up -d sqlserver oracle postgres mysql +time docker compose up -d sqlserver oracle postgres mysql echo "### DONE Bringing Up sqlserver and oracle Images ###" echo "### Checking Docker Images" @@ -28,7 +28,7 @@ echo "### Running Setup for sqlserver ###" # setup sqlserver in docker send_script sqlserver $SQL_SERVER_SCRIPT sqlserver-schema.sql send_script sqlserver ./build/setup_db_scripts.sh setup_db_scripts.sh -time docker-compose exec -T sqlserver bash -c ". setup_db_scripts.sh && setup_sqlserver 127.0.0.1 sqlserver-schema.sql" +time docker compose exec -T sqlserver bash -c ". setup_db_scripts.sh && setup_sqlserver 127.0.0.1 sqlserver-schema.sql" # Can't do absolute paths here so need to do relative mkdir sqlline/ diff --git a/build/setup_db_scripts.sh b/build/setup_db_scripts.sh index 3450cfdadc..51803b3059 100755 --- a/build/setup_db_scripts.sh +++ b/build/setup_db_scripts.sh @@ -135,7 +135,7 @@ function setup_sqlserver() { # Do a simple netcat poll to make sure the oracle database is ready. # All internal database creation and schema setup scripts are handled -# by the container and docker-compose steps. +# by the container and docker compose steps. function setup_oracle() { while ! nc -z $1 1521; do @@ -164,7 +164,7 @@ function setup_oracle() { function send_script() { echo "Send Script Args: 1: $1 - 2 $2 - 3: $3" - docker cp $2 "$(docker-compose ps -q $1)":/$3 + docker cp $2 "$(docker compose ps -q $1)":/$3 } export -f setup_sqlite diff --git a/build/setup_mysql_postgres_databases.sh b/build/setup_mysql_postgres_databases.sh index cfe2b4c22f..1d1e5fbef0 100755 --- a/build/setup_mysql_postgres_databases.sh +++ b/build/setup_mysql_postgres_databases.sh @@ -3,10 +3,10 @@ set -e echo "### Bringing Down Any Docker Containers that May Be Running ###" -time docker-compose down --rmi all +time docker compose down --rmi all echo "### Bringing Up postgres, mysql Images ###" -time docker-compose up -d postgres mysql +time docker compose up -d postgres mysql echo "### Checking Docker Images" docker ps diff --git a/docker-compose-m1.yml b/docker-compose-m1.yml index baebdaf1f2..c7ed258b47 100644 --- a/docker-compose-m1.yml +++ b/docker-compose-m1.yml @@ -1,5 +1,3 @@ -version: '3' - services: postgres: image: postgres:9.6 diff --git a/docker-compose.yml b/docker-compose.yml index e7560ff232..9d7997bfa2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3.7' - services: postgres: image: postgres:9.6 diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 2b5cdaf731..70e6b69b6a 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -16,7 +16,7 @@ If you are running Linux, you should also install Docker Compose separately, as After installing Docker and Docker Compose you have to setup databases: ```bash -docker-compose run --rm setup +docker compose run --rm setup ``` After that you are ready to build and test the project. The following steps describes how to test the project with @@ -28,7 +28,7 @@ when running Docker on non-linux OS due to high IO overhead from running To build and test the project: ```bash -docker-compose run --rm sbt sbt test +docker compose run --rm sbt sbt test ``` ## Building Scala.js targets @@ -41,7 +41,7 @@ The CI build also sets this `project quill-with-js` to force the Scala.js compil If any file that creates a database schema was changed then you have to setup the databases again: ```bash -docker-compose down && docker-compose run --rm setup +docker compose down && docker compose run --rm setup ``` ## Changing docker configuration @@ -49,7 +49,7 @@ docker-compose down && docker-compose run --rm setup If `build/Dockerfile-sbt`, `build/Dockerfile-setup`, `docker-compose.yml` or any file used by them was changed then you have to rebuild docker images and to setup the databases again: ```bash -docker-compose down && docker-compose build && docker-compose run --rm setup +docker compose down && docker compose build && docker compose run --rm setup ``` ## Tests @@ -58,28 +58,28 @@ docker-compose down && docker-compose build && docker-compose run --rm setup Run all tests: ```bash -docker-compose run --rm sbt sbt test +docker compose run --rm sbt sbt test ``` Run specific test: ```bash -docker-compose run --rm sbt sbt "test-only io.getquill.context.sql.SqlQuerySpec" +docker compose run --rm sbt sbt "test-only io.getquill.context.sql.SqlQuerySpec" ``` Run all tests in specific sub-project: ```bash -docker-compose run --rm sbt sbt "project quill-jdbc-zio" test +docker compose run --rm sbt sbt "project quill-jdbc-zio" test ``` Run specific test in specific sub-project: ```bash -docker-compose run --rm sbt sbt "project quill-sqlJVM" "test-only io.getquill.context.sql.SqlQuerySpec" +docker compose run --rm sbt sbt "project quill-sqlJVM" "test-only io.getquill.context.sql.SqlQuerySpec" ``` ### Debugging tests 1. Run sbt in interactive mode with docker container ports mapped to the host: ```bash -docker-compose run --service-ports --rm sbt +docker compose run --service-ports --rm sbt ``` 2. Attach debugger to port 15005 of your docker host. In IntelliJ IDEA you should create Remote Run/Debug Configuration, @@ -97,8 +97,8 @@ In order to contribute to the project, just do as follows: 2. Build it locally 3. Code 4. Compile (file will be formatted) -5. Run the tests through `docker-compose run sbt sbt test` -6. If you made changes in *.md files, run `docker-compose run sbt sbt tut` to validate them +5. Run the tests through `docker compose run sbt sbt test` +6. If you made changes in *.md files, run `docker compose run sbt sbt tut` to validate them 7. If everything is ok, commit and push to your fork 8. Create a Pull Request, we'll be glad to review it @@ -136,7 +136,7 @@ branch will be capable of becoming a pull-request. To restart your database service with database ports exposed to your host machine run: ```bash -docker-compose down && docker-compose run --rm --service-ports setup +docker compose down && docker compose run --rm --service-ports setup ``` After that we need to set some environment variables in order to run `sbt` locally. @@ -169,7 +169,7 @@ Finally, you can use `sbt` locally. To restart the database services, rebuild them, and start with locally exposed ports run: -docker-compose down && docker-compose build && docker-compose run --rm --service-ports setup +docker compose down && docker compose build && docker compose run --rm --service-ports setup Note: Make sure you have exposed all the ports as mentioned above. diff --git a/docs/changelog.md b/docs/changelog.md index eaf8937c1f..6ebe0301c5 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1215,7 +1215,7 @@ historical moments (`java.sql.Timestamp` extents `java.util.Date`). * [Make decoder function public](https://github.com/getquill/quill/pull/487) * [set the scope of all cassandra context type definitions to public](https://github.com/getquill/quill/pull/492) * [make the cassandra decoder fail when encountering a column with value null](https://github.com/getquill/quill/pull/499) -* [fix Option.{isEmpty, isDefined, nonEmpty} show on action.filter](https://github.com/getquill/quill/pull/505) +* [fix Option.\{isEmpty, isDefined, nonEmpty\} show on action.filter](https://github.com/getquill/quill/pull/505) * [Encoder fix](https://github.com/getquill/quill/pull/503/files) * [enclose operand-queries of SetOperation in parentheses](https://github.com/getquill/quill/pull/510) @@ -1292,7 +1292,7 @@ Migration steps: * [Schema mini-DSL and generated values](https://github.com/getquill/quill/pull/226/files#diff-04c6e90faac2675aa89e2176d2eec7d8R212) * [Support for inline vals in quotation blocks](https://github.com/getquill/quill/pull/271/files#diff-02749abf4d0d51be99715cff7074bc9eR775) -* [Support for Option.{isEmpty, nonEmpty, isDefined}](https://github.com/getquill/quill/pull/238/files#diff-02749abf4d0d51be99715cff7074bc9eR688) +* [Support for Option.\{isEmpty, nonEmpty, isDefined\}](https://github.com/getquill/quill/pull/238/files#diff-02749abf4d0d51be99715cff7074bc9eR688) * [Tolerant function parsing in option operation](https://github.com/getquill/quill/pull/243/files#diff-6858983f3617753cfb9852426edaa121R481) * [quill-sql: rename properties and assignments](https://github.com/getquill/quill/pull/250) * [quill-cassandra: rename properties and assignments](https://github.com/getquill/quill/pull/254) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 34e7828030..6ca3bfc26a 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -2,7 +2,7 @@ import sbt.* import sbt.Keys.* object Version { - val zio = "2.1.6" + val zio = "2.1.9" } sealed trait ExcludeTests diff --git a/project/plugins.sbt b/project/plugins.sbt index 330dcb4bd2..4278a8be05 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -5,8 +5,8 @@ resolvers += "Typesafe repository" at "https://repo.typesafe.com/typesafe/releas addDependencyTreePlugin addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.1.0") -addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.3") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.2.0") +addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.4") addSbtPlugin("com.etsy" % "sbt-compile-quick-plugin" % "1.4.0") addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.3.10") -addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.6.1") diff --git a/quill-engine/src/main/scala/io/getquill/MirrorIdiom.scala b/quill-engine/src/main/scala/io/getquill/MirrorIdiom.scala index d7b0ac510d..b5a15cdc5f 100644 --- a/quill-engine/src/main/scala/io/getquill/MirrorIdiom.scala +++ b/quill-engine/src/main/scala/io/getquill/MirrorIdiom.scala @@ -230,8 +230,8 @@ trait MirrorIdiomBase extends Idiom { case FunctionApply(function, values) => stmt"${scopedTokenizer(function)}.apply(${values.token})" } - private final val `!=` : Statement = stmt"!=" - private final val `==` : Statement = stmt"==" + private final val `!=`: Statement = stmt"!=" + private final val `==`: Statement = stmt"==" private final val _operatorTokenizer: Tokenizer[Any] = Tokenizer[Any] { case EqualityOperator.`_!=` => `!=` case EqualityOperator.`_==` => `==` diff --git a/quill-engine/src/main/scala/io/getquill/idiom/ReifyStatement.scala b/quill-engine/src/main/scala/io/getquill/idiom/ReifyStatement.scala index d074e78810..b1f709b2c5 100644 --- a/quill-engine/src/main/scala/io/getquill/idiom/ReifyStatement.scala +++ b/quill-engine/src/main/scala/io/getquill/idiom/ReifyStatement.scala @@ -196,6 +196,6 @@ object ReifyStatementWithInjectables { } private[idiom] object Tokens { - val `, ` : StringToken = StringToken(", ") - val `)` : StringToken = StringToken(")") + val `, `: StringToken = StringToken(", ") + val `)`: StringToken = StringToken(")") }