mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-26 04:07:50 +00:00
Fix: DatabaseQueue.read is throws, not rethrows
This commit is contained in:
1 parent
8c8a25a73b
commit
a681ccf2b9
4 files changed
+6
-4
No files matched your search
@@ -82,6 +82,8 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception:
|
||||
|
||||
The [Common Table Expressions Guide](Documentation/CommonTableExpressions.md) was updated accordingly.
|
||||
|
||||
- **Fixed**: `DatabaseQueue.read` is now declared `throws` instead of `rethrows`.
|
||||
|
||||
## 5.4.0
|
||||
|
||||
Released February 15, 2021 • [diff](https://github.com/groue/GRDB.swift/compare/v5.3.0...v5.4.0)
|
||||
|
||||
@@ -190,7 +190,7 @@ extension DatabaseQueue {
|
||||
///
|
||||
/// - parameter block: A block that accesses the database.
|
||||
/// - throws: The error thrown by the block.
|
||||
public func read<T>(_ block: (Database) throws -> T) rethrows -> T {
|
||||
public func read<T>(_ block: (Database) throws -> T) throws -> T {
|
||||
try writer.sync { db in
|
||||
try db.readOnly { try block(db) }
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ class DatabaseQueueTests: GRDBTestCase {
|
||||
try dbQueue.write { _ in
|
||||
dispatchPrecondition(condition: .onQueue(targetQueue))
|
||||
}
|
||||
dbQueue.read { _ in
|
||||
try dbQueue.read { _ in
|
||||
dispatchPrecondition(condition: .onQueue(targetQueue))
|
||||
}
|
||||
}
|
||||
@@ -185,7 +185,7 @@ class DatabaseQueueTests: GRDBTestCase {
|
||||
try dbQueue.write { _ in
|
||||
dispatchPrecondition(condition: .onQueue(targetQueue))
|
||||
}
|
||||
dbQueue.read { _ in
|
||||
try dbQueue.read { _ in
|
||||
dispatchPrecondition(condition: .onQueue(targetQueue))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -378,7 +378,7 @@ class DatabaseTests : GRDBTestCase {
|
||||
|
||||
func testMaximumStatementArgumentCount() throws {
|
||||
let dbQueue = try makeDatabaseQueue()
|
||||
let count = dbQueue.read { $0.maximumStatementArgumentCount }
|
||||
let count = try dbQueue.read { $0.maximumStatementArgumentCount }
|
||||
// 999 should be safe: https://www.sqlite.org/limits.html
|
||||
XCTAssertGreaterThanOrEqual(count, 999)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user