Skip to content
Merged
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: 43 additions & 43 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'
POSTGRES_DB_A: 'test_database'
POSTGRES_DB_B: 'test_database'
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,29 +42,29 @@ jobs:
fail-fast: false
matrix:
postgres-image:
- postgres:17
- postgres:15
- postgres:13
- postgres:18
- postgres:16
- postgres:14
Copy link
Contributor

Choose a reason for hiding this comment

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

We should keep pg 13 I'd say, as long as Postgres themselves are supporting it.

Copy link
Member Author

Choose a reason for hiding this comment

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

There were no protocol changes between 13 and 14, so I see no point in making the test matrix even larger; it doesn't actually tell you anything that the test for 14 doesn't.

Copy link
Contributor

Choose a reason for hiding this comment

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

I wasnt thinking about a larger matrix. Mostly just replacing 14 with 13

swift-image:
- swift:5.10-jammy
- swift:6.0-noble
- swift:6.1-noble
- swift:6.2-noble
include:
- postgres-image: postgres:17
- postgres-image: postgres:18
postgres-auth: scram-sha-256
- postgres-image: postgres:15
- postgres-image: postgres:16
postgres-auth: md5
- postgres-image: postgres:13
- postgres-image: postgres:14
postgres-auth: trust
runs-on: ubuntu-latest
container: ${{ matrix.swift-image }}
services:
psql-a:
*postgres_host_a:
image: ${{ matrix.postgres-image }}
env:
POSTGRES_USER: test_username
POSTGRES_DB: test_database
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 }}
steps:
Expand All @@ -73,7 +73,7 @@ jobs:
- name: Check out package
uses: actions/checkout@v5
- name: Run local tests
run: swift test --enable-code-coverage
run: swift test --enable-code-coverage --explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable
- name: Upload coverage data
uses: vapor/[email protected]
with:
Expand All @@ -82,22 +82,22 @@ jobs:
linux-integration:
if: ${{ !(github.event.pull_request.draft || false) }}
runs-on: ubuntu-latest
container: swift:6.1-noble
container: swift:6.2-noble
services:
psql-a:
image: postgres:17
*postgres_host_a:
image: postgres:18
env:
POSTGRES_USER: test_username
POSTGRES_DB: test_database
POSTGRES_PASSWORD: test_password
POSTGRES_USER: *postgres_user_a
POSTGRES_DB: *postgres_db_a
POSTGRES_PASSWORD: *postgres_pass_a
POSTGRES_HOST_AUTH_METHOD: scram-sha-256
POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256
psql-b:
image: postgres:15
*postgres_host_b:
image: postgres:16
env:
POSTGRES_USER: test_username
POSTGRES_DB: test_database
POSTGRES_PASSWORD: test_password
POSTGRES_USER: *postgres_user_b
POSTGRES_DB: *postrges_db_b
POSTGRES_PASSWORD: *postgres_pass_b
POSTGRES_HOST_AUTH_METHOD: scram-sha-256
POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256
steps:
Expand All @@ -118,10 +118,10 @@ jobs:
fail-fast: false
matrix:
include:
- macos-version: macos-14
xcode-version: latest-stable
- macos-version: macos-15
xcode-version: latest-stable
- macos-version: macos-26
xcode-version: latest-stable
runs-on: ${{ matrix.macos-version }}
env:
POSTGRES_HOSTNAME: 127.0.0.1
Expand All @@ -135,27 +135,27 @@ jobs:
run: |
brew upgrade || true
export PATH="$(brew --prefix)/opt/postgresql@13/bin:$PATH" PGDATA=/tmp/vapor-postgres-test
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}" --pwfile=<(echo "${POSTGRES_PASSWORD}")
pg_ctl start --wait
timeout-minutes: 15
- name: Checkout code
uses: actions/checkout@v5
- name: Run local tests
run: swift test --enable-code-coverage
run: swift test --enable-code-coverage --explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable
- name: Upload coverage data
uses: vapor/[email protected]
with:
codecov_token: ${{ secrets.CODECOV_TOKEN || '' }}

musl:
runs-on: ubuntu-latest
container: swift:6.1-noble
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.1.2-release/static-sdk/swift-6.1.2-RELEASE/swift-6.1.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz --checksum df0b40b9b582598e7e3d70c82ab503fd6fbfdff71fd17e7f1ab37115a0665b3b
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/postgres-nio.git", from: "1.27.0"),
.package(url: "https://github.com/vapor/sql-kit.git", from: "3.33.1"),
.package(url: "https://github.com/vapor/sql-kit.git", from: "3.33.2"),
.package(url: "https://github.com/vapor/async-kit.git", from: "1.21.0"),
],
targets: [
Expand All @@ -40,9 +40,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"),
.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/postgres-kit/actions/workflows/test.yml"><img src="https://img.shields.io/github/actions/workflow/status/vapor/postgres-kit/test.yml?event=push&style=plastic&logo=github&label=tests&logoColor=%23ccc" alt="Continuous Integration"></a>
<a href="https://codecov.io/github/vapor/postgres-kit"><img src="https://img.shields.io/codecov/c/github/vapor/postgres-kit?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/postgres-kit"><img src="https://img.shields.io/codecov/c/github/vapor/postgres-kit?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/PostgresKit/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": {
"psqlkit": "#336791",
"documentation-intro-fill": "radial-gradient(circle at top, var(--color-psqlkit) 30%, #000 100%)",
"documentation-intro-accent": "var(--color-psqlkit)",
"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
4 changes: 0 additions & 4 deletions Sources/PostgresKit/PostgresDataTranslation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@ extension URL {
}
}

#if compiler(>=6.0)
extension URL: @retroactive PostgresNonThrowingEncodable, @retroactive PostgresDecodable {}
#else
extension Foundation.URL: PostgresNIO.PostgresNonThrowingEncodable, PostgresNIO.PostgresDecodable {}
#endif

struct PostgresDataTranslation {
/// This typealias serves to limit the deprecation noise caused by `PostgresDataConvertible` to a single
Expand Down
Loading