Skip to content

Commit

Permalink
README update (#261)
Browse files Browse the repository at this point in the history
* Add note that non-Fluent users should take advantage of PostgresClient
* Update docs theme
* CI: Update codecov action version, reenable TSan, add coverage of PostgreSQL 13
  • Loading branch information
gwynne authored Apr 18, 2024
1 parent e26763a commit 9d12f46
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 18 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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) }}
Expand All @@ -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:
Expand Down Expand Up @@ -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) }}
Expand Down Expand Up @@ -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) }}
Expand All @@ -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
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 8 additions & 4 deletions Sources/PostgresKit/Docs.docc/PostgresKit.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Sources/PostgresKit/Docs.docc/theme-settings.json
Original file line number Diff line number Diff line change
@@ -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" },
Expand Down

0 comments on commit 9d12f46

Please sign in to comment.