diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 42dee82..2423c1d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ jobs: dependents-check: if: ${{ !(github.event.pull_request.draft || false) }} runs-on: ubuntu-latest - container: swift:5.8-jammy + container: swift:5.9-jammy steps: - name: Check out package uses: actions/checkout@v4 diff --git a/Sources/SQLiteKit/SQLiteRow+SQLRow.swift b/Sources/SQLiteKit/SQLiteRow+SQLRow.swift index fef8ab1..75081cf 100644 --- a/Sources/SQLiteKit/SQLiteRow+SQLRow.swift +++ b/Sources/SQLiteKit/SQLiteRow+SQLRow.swift @@ -8,7 +8,7 @@ extension SQLiteRow: SQLRow { public func decodeNil(column: String) throws -> Bool { guard let data = self.column(column) else { - throw MissingColumn(column: column) + return true } return data == .null } diff --git a/Tests/SQLiteKitTests/SQLiteKitTests.swift b/Tests/SQLiteKitTests/SQLiteKitTests.swift index 39217c6..600641a 100644 --- a/Tests/SQLiteKitTests/SQLiteKitTests.swift +++ b/Tests/SQLiteKitTests/SQLiteKitTests.swift @@ -176,13 +176,13 @@ final class SQLiteKitTests: XCTestCase { XCTAssertEqual(try row1.decode(column: "value", as: String?.self), "abc") XCTAssertThrowsError(try row1.decode(column: "value", as: Int.self)) XCTAssertThrowsError(try row1.decode(column: "nonexistent", as: String?.self)) - XCTAssertThrowsError(try row1.decodeNil(column: "nonexistent")) + XCTAssertTrue(try row1.decodeNil(column: "nonexistent")) XCTAssertTrue(row2.contains(column: "value")) XCTAssertTrue(try row2.decodeNil(column: "value")) XCTAssertEqual(try row2.decode(column: "value", as: String?.self), nil) XCTAssertThrowsError(try row2.decode(column: "value", as: Int.self)) XCTAssertThrowsError(try row2.decode(column: "nonexistent", as: String?.self)) - XCTAssertThrowsError(try row2.decodeNil(column: "nonexistent")) + XCTAssertTrue(try row2.decodeNil(column: "nonexistent")) } func testRowEncoding() async throws {