diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f3306a4..a275081 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,7 +72,9 @@ jobs: - name: Run unit tests for coverage data run: swift test --enable-code-coverage - name: Upload coverage data - uses: vapor/swift-codecov-action@v0.2 + uses: vapor/swift-codecov-action@v0.3 + with: + codecov_token: ${{ secrets.CODECOV_TOKEN }} gh-codeql: if: ${{ false && !(github.event.pull_request.draft || false) }} @@ -87,18 +89,12 @@ jobs: - name: Mark repo safe in non-fake global config run: | git config --global --add safe.directory "${GITHUB_WORKSPACE}" - - name: Check Swift compatibility - id: swift-check - uses: vapor/ci/.github/actions/check-compatible-swift@main - name: Initialize CodeQL - if: ${{ steps.swift-check.outputs.swift-compatible == 'true' }} uses: github/codeql-action/init@v3 with: { languages: swift } - name: Perform build - if: ${{ steps.swift-check.outputs.swift-compatible == 'true' }} run: swift build - name: Run CodeQL analyze - if: ${{ steps.swift-check.outputs.swift-compatible == 'true' }} uses: github/codeql-action/analyze@v3 linux-unit: @@ -137,7 +133,7 @@ jobs: - name: Check out package uses: actions/checkout@v4 - name: Run local tests - run: swift test + run: swift test --sanitize=thread linux-integration: if: ${{ !(github.event.pull_request.draft || false) }} @@ -170,7 +166,7 @@ jobs: - name: Use local package run: swift package --package-path fluent-postgres-driver edit postgres-kit --path postgres-kit - name: Run fluent-postgres-kit tests - run: swift test --package-path fluent-postgres-driver + run: swift test --package-path fluent-postgres-driver --sanitize=thread macos-unit: if: ${{ !(github.event.pull_request.draft || false) }} @@ -194,12 +190,12 @@ jobs: - name: Install Postgres, setup DB and auth, and wait for server start run: | brew upgrade || true - export PATH="$(brew --prefix)/opt/postgresql@14/bin:$PATH" PGDATA=/tmp/vapor-postgres-test - (brew unlink postgresql@14 || true) && brew install "postgresql@15" && brew link --force "postgresql@15" + export PATH="$(brew --prefix)/opt/postgresql@13/bin:$PATH" PGDATA=/tmp/vapor-postgres-test + (brew unlink postgresql@14 || true) && brew install "postgresql@13" && brew link --force "postgresql@13" initdb --locale=C --auth-host "scram-sha-256" -U "${POSTGRES_USER}" --pwfile=<(echo "${POSTGRES_PASSWORD}") pg_ctl start --wait timeout-minutes: 15 - name: Checkout code uses: actions/checkout@v4 - name: Run local tests - run: swift test + run: swift test --sanitize=thread diff --git a/README.md b/README.md index 1c5d7db..9d65fa1 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,15 @@ PostgresKit supports the following platforms: ## Overview -PostgresKit is a PostgreSQL client library built on [SQLKit](https://github.com/vapor/sql-kit). It supports building and serializing Postgres-dialect SQL queries. PostgresKit uses [PostgresNIO](https://github.com/vapor/postgres-nio) to connect and communicate with the database server asynchronously. [AsyncKit](https://github.com/vapor/async-kit) is used to provide connection pooling. +PostgresKit is an [SQLKit] driver for PostgreSQL cliets. It supports building and serializing Postgres-dialect SQL queries. PostgresKit uses [PostgresNIO] to connect and communicate with the database server asynchronously. [AsyncKit](https://github.com/vapor/async-kit) is used to provide connection pooling. + +> [!IMPORTANT] +> It is strongly recommended that users who leverage PostgresKit directly (e.g. absent the Fluent ORM layer) take advantage of PostgresNIO's [PostgresClient] API for connection management rather than relying upon the legacy AsyncKit API. + +[SQLKit]: https://github.com/vapor/sql-kit +[PostgresNIO]: https://github.com/vapor/postgres-nio +[AsyncKit]: https://github.com/vapor/async-kit +[PostgresClient]: https://api.vapor.codes/postgresnio/documentation/postgresnio/postgresclient ### Configuration diff --git a/Sources/PostgresKit/Docs.docc/PostgresKit.md b/Sources/PostgresKit/Docs.docc/PostgresKit.md index 7bca793..4b86941 100644 --- a/Sources/PostgresKit/Docs.docc/PostgresKit.md +++ b/Sources/PostgresKit/Docs.docc/PostgresKit.md @@ -11,18 +11,22 @@ PostgresKit is a library providing an SQLKit driver for PostgresNIO. This package provides the "foundational" level of support for using [Fluent] with PostgreSQL by implementing the requirements of an [SQLKit] driver. It is responsible for: - Managing the underlying PostgreSQL library ([PostgresNIO]), -- Providing a two-way bridge between PostgresNIO and SQLKit's generic data and metadata formats, -- Presenting an interface for establishing, managing, and interacting with database connections. +- Providing a two-way bridge between PostgresNIO and SQLKit's generic data and metadata formats, and +- Presenting an interface for establishing, managing, and interacting with database connections via [AsyncKit]. -> Note: The FluentKit driver for PostgreSQL is provided by the [FluentPostgresDriver] package. +> Important: It is strongly recommended that users who leverage PostgresKit directly (e.g. absent the Fluent ORM layer) take advantage of PostgresNIO's [PostgresClient] API for connection management rather than relying upon the legacy AsyncKit-based support. + +> Tip: A FluentKit driver for PostgreSQL is provided by the [FluentPostgresDriver] package. ## Version Support This package uses [PostgresNIO] for all underlying database interactions. It is compatible with all versions of PostgreSQL and all platforms supported by that package. -> Important: There is one exception to the above at the time of this writing: This package requires Swift 5.7 or newer, whereas PostgresNIO continues to support Swift 5.6. +> Caution: There is one exception to the above at the time of this writing: This package requires Swift 5.8 or newer, whereas PostgresNIO continues to support Swift 5.6. [SQLKit]: https://swiftpackageindex.com/vapor/sql-kit [PostgresNIO]: https://swiftpackageindex.com/vapor/postgres-nio [Fluent]: https://swiftpackageindex.com/vapor/fluent-kit [FluentPostgresDriver]: https://swiftpackageindex.com/vapor/fluent-postgres-driver +[AsyncKit]: https://swiftpackageindex.com/vapor/async-kit +[PostgresClient]: https://api.vapor.codes/postgresnio/documentation/postgresnio/postgresclient diff --git a/Sources/PostgresKit/Docs.docc/theme-settings.json b/Sources/PostgresKit/Docs.docc/theme-settings.json index b147e23..de0d11a 100644 --- a/Sources/PostgresKit/Docs.docc/theme-settings.json +++ b/Sources/PostgresKit/Docs.docc/theme-settings.json @@ -1,6 +1,6 @@ { "theme": { - "aside": { "border-radius": "6px", "border-style": "double", "border-width": "3px" }, + "aside": { "border-radius": "16px", "border-style": "double", "border-width": "3px" }, "border-radius": "0", "button": { "border-radius": "16px", "border-width": "1px", "border-style": "solid" }, "code": { "border-radius": "16px", "border-width": "1px", "border-style": "solid" },