Skip to content

Commit

Permalink
Update for compatibility with the composite primary key support branc…
Browse files Browse the repository at this point in the history
…h in FluentKit (#50)

* Drop Swift 5.2 and 5.3 support
* Add the composite ID benchmark tests.
* Require current version of Fluent
  • Loading branch information
gwynne authored Jun 13, 2022
1 parent 007dec2 commit e96cf41
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
dbimage:
- mongo
runner:
- swift:5.2-focal
- swift:5.4-focal
- swift:5.5-focal
- swift:5.6-focal
- swiftlang/swift:nightly-main-focal
Expand All @@ -24,7 +24,7 @@ jobs:
- name: Check out code
uses: actions/checkout@v3
- name: Run tests with Thread Sanitizer
run: swift test --enable-test-discovery --sanitize=thread
run: swift test --sanitize=thread
env:
MONGO_HOSTNAME_A: mongo-a
MONGO_HOSTNAME_B: mongo-b
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.2
// swift-tools-version:5.4
import PackageDescription

let package = Package(
Expand All @@ -10,7 +10,7 @@ let package = Package(
.library(name: "FluentMongoDriver", targets: ["FluentMongoDriver"]),
],
dependencies: [
.package(url: "https://github.com/vapor/fluent-kit.git", from: "1.24.0"),
.package(url: "https://github.com/vapor/fluent-kit.git", from: "1.27.0"),
.package(url: "https://github.com/OpenKitten/MongoKitten.git", from: "6.6.4"),
],
targets: [
Expand Down
2 changes: 1 addition & 1 deletion Sources/FluentMongoDriver/MongoDB+Schema.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extension FluentMongoDatabase {
continue nextConstraint
}
switch algorithm {
case .unique(let fields):
case .unique(let fields), .compositeIdentifier(let fields):
let indexKeys = try fields.map { field -> String in
switch field {
case .key(let key):
Expand Down
1 change: 1 addition & 0 deletions Tests/FluentMongoDriverTests/FluentMongoDriverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ final class FluentMongoDriverTests: XCTestCase {
func testBatch() throws { try self.benchmarker.testBatch() }
func testChildren() throws { try self.benchmarker.testChildren() }
func testChunk() throws { try self.benchmarker.testChunk() }
func testCompositeID() throws { try self.benchmarker.testCompositeID() }
func testCRUD() throws { try self.benchmarker.testCRUD() }
func testEagerLoad() throws { try self.benchmarker.testEagerLoad() }
func testEnum() throws { try self.benchmarker.testEnum() }
Expand Down
2 changes: 0 additions & 2 deletions Tests/LinuxMain.swift

This file was deleted.

0 comments on commit e96cf41

Please sign in to comment.