Skip to content

Commit

Permalink
Adopt Async APIs (#226)
Browse files Browse the repository at this point in the history
* Drop support for 5.8

* Bump dependencies

* Adopt new Asnyc APIs

* Update CI
  • Loading branch information
0xTim authored Oct 6, 2024
1 parent 93e7254 commit c1422fd
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 57 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ jobs:
- percona:8.0
runner:
# List is deliberately incomplete; we want to avoid running 50 jobs on every commit
- swift:5.8-focal
- swift:5.9-focal
- swift:5.10-jammy
- swiftlang/swift:nightly-6.0-jammy
- swift:6.0-jammy
container: ${{ matrix.runner }}
runs-on: ubuntu-latest
services:
Expand Down Expand Up @@ -86,8 +86,6 @@ jobs:
fail-fast: false
matrix:
include:
- macos-version: macos-13
xcode-version: '~14.3'
- macos-version: macos-14
xcode-version: latest
runs-on: ${{ matrix.macos-version }}
Expand Down
7 changes: 5 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.8
// swift-tools-version:5.9
import PackageDescription

let package = Package(
Expand All @@ -13,7 +13,7 @@ let package = Package(
.library(name: "FluentMySQLDriver", targets: ["FluentMySQLDriver"]),
],
dependencies: [
.package(url: "https://github.com/vapor/fluent-kit.git", from: "1.48.4"),
.package(url: "https://github.com/vapor/fluent-kit.git", from: "1.49.0"),
.package(url: "https://github.com/vapor/mysql-kit.git", from: "4.9.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.4"),
],
Expand All @@ -40,6 +40,9 @@ let package = Package(
)

var swiftSettings: [SwiftSetting] { [
.enableUpcomingFeature("ExistentialAny"),
.enableUpcomingFeature("ConciseMagicFile"),
.enableUpcomingFeature("ForwardTrailingClosures"),
.enableUpcomingFeature("DisableOutwardActorInference"),
.enableExperimentalFeature("StrictConcurrency=complete"),
] }
48 changes: 0 additions & 48 deletions [email protected]

This file was deleted.

4 changes: 4 additions & 0 deletions Sources/FluentMySQLDriver/FluentMySQLDriver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@ struct FluentMySQLDriver: DatabaseDriver {
func shutdown() {
try? self.pool.syncShutdownGracefully()
}

func shutdownAsync() async {
try? await self.pool.shutdownAsync()
}
}
6 changes: 3 additions & 3 deletions Tests/FluentMySQLDriverTests/FluentMySQLDriverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,10 @@ final class FluentMySQLDriverTests: XCTestCase {
), as: .b)
}

override func tearDownWithError() throws {
self.dbs.shutdown()
override func tearDown() async throws {
await self.dbs.shutdownAsync()

try super.tearDownWithError()
try await super.tearDown()
}
}

Expand Down

0 comments on commit c1422fd

Please sign in to comment.