diff --git a/CHANGELOG.md b/CHANGELOG.md index e619f632d..9737ef227 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,15 +3,29 @@ Release Notes ## Next Version +### Fixed + +- The `write` and `unsafeReentrantRead` DatabaseQueue methods used to have an incorrect `throws/rethrows` qualifier. + + +### New + - [#397](https://github.com/groue/GRDB.swift/pull/397): JSON encoding and decoding of codable record properties - [#393](https://github.com/groue/GRDB.swift/pull/393): Upgrade SQLCipher to 3.4.2, enable FTS5 on GRDBCipher and new pod GRDBPlus. - [#384](https://github.com/groue/GRDB.swift/pull/384): Improve database value decoding diagnostics +- Cursors of optimized values (Strint, Int, Date, etc.) have been renamed: FastDatabaseValueCursor and FastNullableDatabaseValueCursor replace the deprecated ColumnCursor and NullableColumnCursor. + ### API diff -Cursors of optimized values (Strint, Int, Date, etc.) have been renamed: use FastDatabaseValueCursor and FastNullableDatabaseValueCursor instead of the deprecated ColumnCursor and NullableColumnCursor. - ```diff + class DatabaseQueue { +- func write(_ block: (Database) throws -> T) rethrows -> T { ++ func write(_ block: (Database) throws -> T) throws -> T { +- func unsafeReentrantRead(_ block: (Database) throws -> T) throws -> T { ++ func unsafeReentrantRead(_ block: (Database) throws -> T) rethrows -> T { + } + +final class FastDatabaseValueCursor : Cursor { } +@available(*, deprecated, renamed: "FastDatabaseValueCursor") +typealias ColumnCursor = FastDatabaseValueCursor @@ -19,9 +33,9 @@ Cursors of optimized values (Strint, Int, Date, etc.) have been renamed: use Fas +final class FastNullableDatabaseValueCursor : Cursor { } +@available(*, deprecated, renamed: "FastNullableDatabaseValueCursor") +typealias NullableColumnCursor = FastNullableDatabaseValueCursor - ``` + ### Documentation Diff - [Enabling FTS5 Support](README.md#enabling-fts5-support): Procedure for enabling FTS5 support in GRDB. diff --git a/GRDB/Core/DatabaseQueue.swift b/GRDB/Core/DatabaseQueue.swift index c9afc7f10..2cad67b1b 100644 --- a/GRDB/Core/DatabaseQueue.swift +++ b/GRDB/Core/DatabaseQueue.swift @@ -191,7 +191,7 @@ extension DatabaseQueue { /// concurrency practices. /// /// :nodoc: - public func unsafeReentrantRead(_ block: (Database) throws -> T) throws -> T { + public func unsafeReentrantRead(_ block: (Database) throws -> T) rethrows -> T { return try writer.reentrantSync(block) } @@ -232,7 +232,7 @@ extension DatabaseQueue { /// /// - parameter block: A block that executes SQL statements. /// - throws: An eventual database error, or the error thrown by the block. - public func write(_ block: (Database) throws -> T) rethrows -> T { + public func write(_ block: (Database) throws -> T) throws -> T { return try writer.sync { db in var result: T? = nil try db.inTransaction {