Skip to content

Commit

Permalink
Merge branch 'master' into replace_SheathLeafClauses
Browse files Browse the repository at this point in the history
  • Loading branch information
juliano authored Sep 11, 2024
2 parents 6292a40 + d6cc949 commit ee55e69
Show file tree
Hide file tree
Showing 19 changed files with 58 additions and 59 deletions.
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Scala Steward: Reformat with scalafmt 3.7.5
d8a77dfb017feae820e38eea0d7b5128b13a737d

# Scala Steward: Reformat with scalafmt 3.8.3
1b7c658737faa53ec506fb403892320773282488
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand All @@ -110,7 +110,7 @@ jobs:
steps:
- uses: actions/[email protected]
- name: Setup Java
uses: actions/setup-java@v3.12.0
uses: actions/setup-java@v4.2.2
with:
distribution: temurin
java-version: '11'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scala-steward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.8.2"
version = "3.8.3"
maxColumn = 240
align.preset = most
align.multiline = false
Expand Down
22 changes: 11 additions & 11 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"
),
Expand All @@ -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"
Expand Down Expand Up @@ -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 =>
Expand Down Expand Up @@ -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(
Expand All @@ -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
Expand Down Expand Up @@ -597,15 +597,15 @@ 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"

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
)
)

Expand Down
2 changes: 1 addition & 1 deletion build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions build/m1/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -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!
4 changes: 2 additions & 2 deletions build/setup_bigdata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

set -e

time docker-compose up -d cassandra orientdb
time docker compose up -d cassandra orientdb

# import setup functions
. build/setup_db_scripts.sh

# 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!"
6 changes: 3 additions & 3 deletions build/setup_databases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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/
Expand Down
4 changes: 2 additions & 2 deletions build/setup_db_scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions build/setup_mysql_postgres_databases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions docker-compose-m1.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
postgres:
image: postgres:9.6
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.7'

services:
postgres:
image: postgres:9.6
Expand Down
26 changes: 13 additions & 13 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -41,15 +41,15 @@ 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

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
Expand All @@ -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,
Expand All @@ -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

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import sbt.*
import sbt.Keys.*

object Version {
val zio = "2.1.6"
val zio = "2.1.9"
}

sealed trait ExcludeTests
Expand Down
6 changes: 3 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Loading

0 comments on commit ee55e69

Please sign in to comment.