diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c0ce1bae3c..b13380ec18 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: fail-fast: false matrix: scala: [2.12.x, 2.13.x, 3.3.x] - module: [base, db, async, codegen, bigdata] + module: [base, db, codegen, bigdata] include: - scala: 2.12.x scala_short: 212 @@ -40,8 +40,6 @@ jobs: # For now, only do the `base` build for Scala 3 - scala: 3.3.x module: db - - scala: 3.3.x - module: async - scala: 3.3.x module: codegen - scala: 3.3.x diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index f4e868956a..2b5cdaf731 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -68,7 +68,7 @@ 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-async" test +docker-compose run --rm sbt sbt "project quill-jdbc-zio" test ``` Run specific test in specific sub-project: diff --git a/docs/contexts.md b/docs/contexts.md index 323a57f425..20af085421 100644 --- a/docs/contexts.md +++ b/docs/contexts.md @@ -1023,181 +1023,6 @@ ctx.dataSource.portNumber=1521 ctx.dataSource.serverName=host ``` -## NDBC Context - -Async support via [NDBC driver](https://ndbc.io/) is available with Postgres database. - -### quill-ndbc-postgres - -#### transactions - -Transaction support is provided out of the box by NDBC: - -```scala -ctx.transaction { - ctx.run(query[Person].delete) - // other transactional code -} -``` - -The body of transaction can contain calls to other methods and multiple run calls since the transaction is automatically handled. - -#### sbt dependencies - -``` -libraryDependencies ++= Seq( - "io.getquill" %% "quill-ndbc-postgres" % "@VERSION@" -) -``` - -#### context definition -```scala -lazy val ctx = new NdbcPostgresContext(Literal, "ctx") -``` - -#### application.properties -``` -ctx.ndbc.dataSourceSupplierClass=io.trane.ndbc.postgres.netty4.DataSourceSupplier -ctx.ndbc.host=host -ctx.ndbc.port=1234 -ctx.ndbc.user=root -ctx.ndbc.password=root -ctx.ndbc.database=database -``` - -## quill-async - -The `quill-async` module provides simple async support for MySQL and Postgres databases. - -#### transactions - -The async module provides transaction support based on a custom implicit execution context: - -``` -ctx.transaction { implicit ec => - ctx.run(query[Person].delete) - // other transactional code -} -``` - -The body of `transaction` can contain calls to other methods and multiple `run` calls, but the transactional code must be done using the provided implicit execution context. For instance: - -``` -def deletePerson(name: String)(implicit ec: ExecutionContext) = - ctx.run(query[Person].filter(_.name == lift(name)).delete) - -ctx.transaction { implicit ec => - deletePerson("John") -} -``` - -Depending on how the main execution context is imported, it is possible to produce an ambiguous implicit resolution. A way to solve this problem is shadowing the multiple implicits by using the same name: - -``` -import scala.concurrent.ExecutionContext.Implicits.{ global => ec } - -def deletePerson(name: String)(implicit ec: ExecutionContext) = - ctx.run(query[Person].filter(_.name == lift(name)).delete) - -ctx.transaction { implicit ec => - deletePerson("John") -} -``` - -Note that the global execution context is renamed to ec. - -#### application.properties - -##### connection configuration -``` -ctx.host=host -ctx.port=1234 -ctx.user=root -ctx.password=root -ctx.database=database -``` - -or use connection URL with database-specific scheme (see below): - -``` -ctx.url=scheme://host:5432/database?user=root&password=root -``` - -##### connection pool configuration -``` -ctx.poolMaxQueueSize=4 -ctx.poolMaxObjects=4 -ctx.poolMaxIdle=999999999 -ctx.poolValidationInterval=10000 -``` - -Also see [`PoolConfiguration` documentation](https://github.com/mauricio/postgresql-async/blob/master/db-async-common/src/main/scala/com/github/mauricio/async/db/pool/PoolConfiguration.scala). - -##### SSL configuration -``` -ctx.sslmode=disable # optional, one of [disable|prefer|require|verify-ca|verify-full] -ctx.sslrootcert=./path/to/cert/file # optional, required for sslmode=verify-ca or verify-full -``` - -##### other -``` -ctx.charset=UTF-8 -ctx.maximumMessageSize=16777216 -ctx.connectTimeout=5s -ctx.testTimeout=5s -ctx.queryTimeout=10m -``` - -### quill-async-mysql - -#### sbt dependencies - -``` -libraryDependencies ++= Seq( - "io.getquill" %% "quill-async-mysql" % "@VERSION@" -) -``` - -#### context definition -```scala -lazy val ctx = new MysqlAsyncContext(SnakeCase, "ctx") -``` - -#### application.properties - -See [above](#applicationproperties-5) - -For `url` property use `mysql` scheme: - -``` -ctx.url=mysql://host:3306/database?user=root&password=root -``` - -### quill-async-postgres - -#### sbt dependencies - -``` -libraryDependencies ++= Seq( - "io.getquill" %% "quill-async-postgres" % "@VERSION@" -) -``` - -#### context definition -```scala -lazy val ctx = new PostgresAsyncContext(SnakeCase, "ctx") -``` - -#### application.properties - -See [common properties](#applicationproperties-5) - -For `url` property use `postgresql` scheme: - -``` -ctx.url=postgresql://host:5432/database?user=root&password=root -``` - ## quill-doobie Quill 3.16.5 and above supports Doobie starting 1.0.0-RC1. You can use quill quotes to construct `ConnectionIO` programs. diff --git a/docs/getting-started.md b/docs/getting-started.md index 91072a143b..7901d5e638 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -8,7 +8,7 @@ sidebar_label: "Getting Started" Quill has integrations with many libraries. If you are using a regular RDBMS e.g. PostgreSQL and want to use Quill to query it with an asynchronous, non-blocking, reactive application, the easiest way to get -started is by using an awesome library called ZIO. +started is by using ZIO. A simple ZIO + Quill application looks like this: ```scala diff --git a/docs/quill-vs-slick.md b/docs/quill-vs-slick.md index 78a32ffdf1..3e7a0eaa47 100644 --- a/docs/quill-vs-slick.md +++ b/docs/quill-vs-slick.md @@ -98,7 +98,7 @@ The feedback cycle using Slick is typically longer. Some factors like normalizat ## Non-blocking IO ## -Slick provides an asynchronous wrapper on top of jdbc's blocking interface, making it harder to scale applications using it. On the other hand, quill provides fully asynchronous non-blocking database access through quill-async and quill-finagle-mysql. +Slick provides an asynchronous wrapper on top of jdbc's blocking interface, making it harder to scale applications using it. On the other hand, quill provides fully asynchronous non-blocking database access through quill-zio. ## Extensibility ## diff --git a/docs/writing-queries.md b/docs/writing-queries.md index 87d7d7c195..d0a354bf88 100644 --- a/docs/writing-queries.md +++ b/docs/writing-queries.md @@ -2039,8 +2039,7 @@ case class Book(id: Int, notes: List[String], pages: Vector[Int], history: Seq[D ctx.run(query[Book]) // SELECT x.id, x.notes, x.pages, x.history FROM Book x ``` -Note that not all drivers/databases provides such feature hence only `PostgresJdbcContext` and -`PostgresAsyncContext` support SQL Arrays. +Note that not all drivers/databases provides such feature hence only `PostgresJdbcContext` support SQL Arrays. ## Cassandra-specific encoding