diff --git a/Sources/FluentPostgresDriver/PostgresError+Database.swift b/Sources/FluentPostgresDriver/PostgresError+Database.swift index 4ea2df3..4df360e 100644 --- a/Sources/FluentPostgresDriver/PostgresError+Database.swift +++ b/Sources/FluentPostgresDriver/PostgresError+Database.swift @@ -53,7 +53,12 @@ extension PostgresError: DatabaseError { } public var isConnectionClosed: Bool { - return false + switch self { + case .connectionClosed: + return true + default: + return false + } } public var isConstraintFailure: Bool { diff --git a/Tests/FluentPostgresDriverTests/FluentPostgresDriverTests.swift b/Tests/FluentPostgresDriverTests/FluentPostgresDriverTests.swift index cdb6a44..b96bf8b 100644 --- a/Tests/FluentPostgresDriverTests/FluentPostgresDriverTests.swift +++ b/Tests/FluentPostgresDriverTests/FluentPostgresDriverTests.swift @@ -6,9 +6,7 @@ import XCTest import PostgresKit final class FluentPostgresDriverTests: XCTestCase { - func testAll() throws { try self.benchmarker.testAll() } - - #if Xcode + //func testAll() throws { try self.benchmarker.testAll() } func testAggregate() throws { try self.benchmarker.testAggregate() } func testArray() throws { try self.benchmarker.testArray() } func testBatch() throws { try self.benchmarker.testBatch() } @@ -35,10 +33,10 @@ final class FluentPostgresDriverTests: XCTestCase { func testSiblings() throws { try self.benchmarker.testSiblings() } func testSoftDelete() throws { try self.benchmarker.testSoftDelete() } func testSort() throws { try self.benchmarker.testSort() } + func testSQL() throws { try self.benchmarker.testSQL() } func testTimestamp() throws { try self.benchmarker.testTimestamp() } func testTransaction() throws { try self.benchmarker.testTransaction() } func testUnique() throws { try self.benchmarker.testUnique() } - #endif func testDatabaseError() throws { let sql = (self.db as! SQLDatabase)