Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
push:
branches:
- main
permissions:
contents: read
id-token: write

jobs:
build-and-deploy:
Expand Down
86 changes: 52 additions & 34 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ concurrency:
on:
pull_request: { types: [opened, reopened, synchronize, ready_for_review] }
push: { branches: [ main ] }

permissions:
contents: read
env:
LOG_LEVEL: info
SWIFT_DETERMINISTIC_HASHING: 1
POSTGRES_HOSTNAME: 'psql-a'
POSTGRES_HOSTNAME_A: 'psql-a'
POSTGRES_HOSTNAME_B: 'psql-b'
POSTGRES_DB: 'test_database_a'
POSTGRES_DB_A: 'test_database_a'
POSTGRES_DB_B: 'test_database_b'
POSTGRES_USER: 'test_username'
POSTGRES_USER_A: 'test_username'
POSTGRES_USER_B: 'test_username'
POSTGRES_PASSWORD: 'test_password'
POSTGRES_PASSWORD_A: 'test_password'
POSTGRES_PASSWORD_B: 'test_password'
POSTGRES_HOSTNAME_A: &postgres_host_a 'psql-a'
POSTGRES_HOSTNAME_B: &postgres_host_b 'psql-b'
POSTGRES_HOSTNAME: *postgres_host_a
POSTGRES_DB_A: &postgres_db_a 'test_database_a'
POSTGRES_DB_B: &postgres_db_b 'test_database_b'
POSTGRES_DB: *postgres_db_a
POSTGRES_USER_A: &postgres_user_a 'test_username'
POSTGRES_USER_B: &postgres_user_b 'test_username'
POSTGRES_USER: *postgres_user_a
POSTGRES_PASSWORD_A: &postgres_pass_a 'test_password'
POSTGRES_PASSWORD_B: &postgres_pass_b 'test_password'
POSTGRES_PASSWORD: *postgres_pass_a

jobs:
api-breakage:
Expand All @@ -42,35 +42,35 @@ jobs:
fail-fast: false
matrix:
include:
- postgres-image-a: 'postgres:12'
postgres-image-b: 'postgres:13'
- postgres-image-a: 'postgres:13'
postgres-image-b: 'postgres:14'
postgres-auth: 'trust'
swift-image: 'swift:5.10-jammy'
- postgres-image-a: 'postgres:14'
postgres-image-b: 'postgres:15'
postgres-auth: 'md5'
swift-image: 'swift:6.0-noble'
- postgres-image-a: 'postgres:16'
postgres-image-b: 'postgres:17'
postgres-auth: 'scram-sha-256'
- postgres-image-a: 'postgres:15'
postgres-image-b: 'postgres:16'
postgres-auth: 'md5'
swift-image: 'swift:6.1-noble'
- postgres-image-a: 'postgres:17'
postgres-image-b: 'postgres:18'
postgres-auth: 'scram-sha-256'
swift-image: 'swift:6.2-noble'
container: ${{ matrix.swift-image }}
runs-on: ubuntu-latest
services:
psql-a:
*postgres_host_a:
image: ${{ matrix.postgres-image-a }}
env:
POSTGRES_USER: 'test_username'
POSTGRES_DB: 'test_database_a'
POSTGRES_PASSWORD: 'test_password'
POSTGRES_USER: *postgres_user_a
POSTGRES_DB: *postgres_db_a
POSTGRES_PASSWORD: *postgres_pass_a
POSTGRES_HOST_AUTH_METHOD: ${{ matrix.postgres-auth }}
POSTGRES_INITDB_ARGS: --auth-host=${{ matrix.postgres-auth }}
psql-b:
*postgres_host_b:
image: ${{ matrix.postgres-image-b }}
env:
POSTGRES_USER: 'test_username'
POSTGRES_DB: 'test_database_b'
POSTGRES_PASSWORD: 'test_password'
POSTGRES_USER: *postgres_user_b
POSTGRES_DB: *postgres_db_b
POSTGRES_PASSWORD: *postgres_pass_b
POSTGRES_HOST_AUTH_METHOD: ${{ matrix.postgres-auth }}
POSTGRES_INITDB_ARGS: --auth-host=${{ matrix.postgres-auth }}
steps:
Expand All @@ -79,7 +79,7 @@ jobs:
- name: Check out package
uses: actions/checkout@v5
- name: Run all tests
run: swift test --enable-code-coverage
run: swift test --enable-code-coverage --explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable
- name: Submit coverage report to Codecov.io
uses: vapor/[email protected]
with:
Expand All @@ -93,6 +93,8 @@ jobs:
include:
- macos-version: macos-15
xcode-version: latest-stable
- macos-version: macos-26
xcode-version: latest-stable
runs-on: ${{ matrix.macos-version }}
env:
LOG_LEVEL: debug
Expand All @@ -108,7 +110,7 @@ jobs:
run: |
brew upgrade || true
export PATH="$(brew --prefix)/opt/postgresql@16/bin:$PATH" PGDATA=/tmp/vapor-postgres-test PGUSER="${POSTGRES_USER_A}"
brew install postgresql@17 && brew link --force postgresql@17
brew install postgresql@18 && brew link --force postgresql@18
initdb --locale=C --auth-host "scram-sha-256" -U "${POSTGRES_USER_A}" --pwfile=<(echo "${POSTGRES_PASSWORD_A}")
pg_ctl start --wait
PGPASSWORD="${POSTGRES_PASSWORD_A}" createdb -w -O "${POSTGRES_USER_A}" "${POSTGRES_DB_A}"
Expand All @@ -119,4 +121,20 @@ jobs:
- name: Checkout code
uses: actions/checkout@v5
- name: Run all tests
run: swift test
run: swift test --enable-code-coverage --explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable
- name: Submit coverage report to Codecov.io
uses: vapor/[email protected]
with:
codecov_token: ${{ secrets.CODECOV_TOKEN }}

musl:
runs-on: ubuntu-latest
container: swift:6.2-noble
timeout-minutes: 30
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Install SDK
run: swift sdk install https://download.swift.org/swift-6.2-release/static-sdk/swift-6.2-RELEASE/swift-6.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz --checksum d2225840e592389ca517bbf71652f7003dbf45ac35d1e57d98b9250368769378
- name: Build
run: swift build --swift-sdk x86_64-swift-linux-musl
12 changes: 6 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.10
// swift-tools-version:6.0
import PackageDescription

let package = Package(
Expand All @@ -14,7 +14,7 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/vapor/fluent-kit.git", from: "1.52.2"),
.package(url: "https://github.com/vapor/postgres-kit.git", from: "2.14.0"),
.package(url: "https://github.com/vapor/postgres-kit.git", from: "2.14.1"),
.package(url: "https://github.com/vapor/async-kit.git", from: "1.21.0"),
],
targets: [
Expand All @@ -41,9 +41,9 @@ let package = Package(

var swiftSettings: [SwiftSetting] { [
.enableUpcomingFeature("ExistentialAny"),
.enableUpcomingFeature("InternalImportsByDefault"),
.enableUpcomingFeature("MemberImportVisibility"),
.enableUpcomingFeature("ConciseMagicFile"),
.enableUpcomingFeature("ForwardTrailingClosures"),
.enableUpcomingFeature("DisableOutwardActorInference"),
.enableExperimentalFeature("StrictConcurrency=complete"),
.enableUpcomingFeature("InferIsolatedConformances"),
//.enableUpcomingFeature("NonisolatedNonsendingByDefault"),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To remind myself to make the code compatible with it later. It's not trivial, but should eventually be done.

.enableUpcomingFeature("ImmutableWeakCaptures"),
] }
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<a href="https://discord.gg/vapor"><img src="https://design.vapor.codes/images/discordchat.svg" alt="Team Chat"></a>
<a href="LICENSE"><img src="https://design.vapor.codes/images/mitlicense.svg" alt="MIT License"></a>
<a href="https://github.com/vapor/fluent-postgres-driver/actions/workflows/test.yml"><img src="https://img.shields.io/github/actions/workflow/status/vapor/fluent-postgres-driver/test.yml?event=push&style=plastic&logo=github&label=tests&logoColor=%23ccc" alt="Continuous Integration"></a>
<a href="https://codecov.io/github/vapor/fluent-postgres-driver"><img src="https://img.shields.io/codecov/c/github/vapor/fluent-postgres-driver?style=plastic&logo=codecov&label=codecov"></a>
<a href="https://swift.org"><img src="https://design.vapor.codes/images/swift510up.svg" alt="Swift 5.10+"></a>
<a href="https://codecov.io/github/vapor/fluent-postgres-driver"><img src="https://img.shields.io/codecov/c/github/vapor/fluent-postgres-driver?style=plastic&logo=codecov&label=codecov" alt="Code Coverage"></a>
<a href="https://swift.org"><img src="https://design.vapor.codes/images/swift60up.svg" alt="Swift 6.0+"></a>
</p>

<br>
Expand Down
6 changes: 3 additions & 3 deletions Sources/FluentPostgresDriver/Docs.docc/theme-settings.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"theme": {
"aside": { "border-radius": "16px", "border-style": "double", "border-width": "3px" },
"aside": { "border-radius": "16px", "border-width": "3px", "border-style": "double" },
"border-radius": "0",
"button": { "border-radius": "16px", "border-width": "1px", "border-style": "solid" },
"code": { "border-radius": "16px", "border-width": "1px", "border-style": "solid" },
"color": {
"fluentpsqldriver": "#336791",
"documentation-intro-fill": "radial-gradient(circle at top, var(--color-fluentpsqldriver) 30%, #000 100%)",
"documentation-intro-accent": "var(--color-fluentpsqldriver)",
"documentation-intro-eyebrow": "white",
"hero-eyebrow": "white",
"documentation-intro-figure": "white",
"documentation-intro-title": "white",
"hero-title": "white",
"logo-base": { "dark": "#fff", "light": "#000" },
"logo-shape": { "dark": "#000", "light": "#fff" },
"fill": { "dark": "#000", "light": "#fff" }
Expand Down
5 changes: 0 additions & 5 deletions Sources/FluentPostgresDriver/PostgresError+Database.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,5 @@ extension PSQLError {
}
}

#if compiler(<6)
extension PostgresError: DatabaseError {}
extension PSQLError: DatabaseError {}
#else
extension PostgresError: @retroactive DatabaseError {}
extension PSQLError: @retroactive DatabaseError {}
#endif
Loading
Loading