Skip to content

Commit

Permalink
Explicitly handle a custom ID key set to the empty string (#210)
Browse files Browse the repository at this point in the history
* Add the composite ID benchmark tests.
* Drop support for Swift 5.2 and 5.3
* Require current version of Fluent
  • Loading branch information
gwynne authored Jun 13, 2022
1 parent 50ba00b commit 549eb75
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
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: "FluentMySQLDriver", targets: ["FluentMySQLDriver"]),
],
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/vapor/mysql-kit.git", from: "4.0.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
],
Expand Down
2 changes: 1 addition & 1 deletion Sources/FluentMySQLDriver/FluentMySQLDatabase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extension _FluentMySQLDatabase: Database {
},
onMetadata: { metadata in
switch query.action {
case .create:
case .create where query.customIDKey != .string(""):
let row = LastInsertRow(
metadata: metadata,
customIDKey: query.customIDKey
Expand Down
1 change: 1 addition & 0 deletions Tests/FluentMySQLDriverTests/FluentMySQLDriverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ final class FluentMySQLDriverTests: XCTestCase {
func testChildren() throws { try self.benchmarker.testChildren() }
func testCodable() throws { try self.benchmarker.testCodable() }
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

0 comments on commit 549eb75

Please sign in to comment.