mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-23 04:04:22 +00:00
Fix DatabaseQueue.write and unsafeReentrantRead throws/rethrows qualifier.
This commit is contained in:
1 parent
4d7d5e8429
commit
7be6386689
2 files changed
+19
-5
No files matched your search
+17
-3
@@ -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<T>(_ block: (Database) throws -> T) rethrows -> T {
|
||||
+ func write<T>(_ block: (Database) throws -> T) throws -> T {
|
||||
- func unsafeReentrantRead<T>(_ block: (Database) throws -> T) throws -> T {
|
||||
+ func unsafeReentrantRead<T>(_ block: (Database) throws -> T) rethrows -> T {
|
||||
}
|
||||
|
||||
+final class FastDatabaseValueCursor<Value: DatabaseValueConvertible & StatementColumnConvertible> : Cursor { }
|
||||
+@available(*, deprecated, renamed: "FastDatabaseValueCursor")
|
||||
+typealias ColumnCursor<Value: DatabaseValueConvertible & StatementColumnConvertible> = FastDatabaseValueCursor<Value>
|
||||
@@ -19,9 +33,9 @@ Cursors of optimized values (Strint, Int, Date, etc.) have been renamed: use Fas
|
||||
+final class FastNullableDatabaseValueCursor<Value: DatabaseValueConvertible & StatementColumnConvertible> : Cursor { }
|
||||
+@available(*, deprecated, renamed: "FastNullableDatabaseValueCursor")
|
||||
+typealias NullableColumnCursor<Value: DatabaseValueConvertible & StatementColumnConvertible> = FastNullableDatabaseValueCursor<Value>
|
||||
|
||||
```
|
||||
|
||||
|
||||
### Documentation Diff
|
||||
|
||||
- [Enabling FTS5 Support](README.md#enabling-fts5-support): Procedure for enabling FTS5 support in GRDB.
|
||||
|
||||
@@ -191,7 +191,7 @@ extension DatabaseQueue {
|
||||
/// concurrency practices.
|
||||
///
|
||||
/// :nodoc:
|
||||
public func unsafeReentrantRead<T>(_ block: (Database) throws -> T) throws -> T {
|
||||
public func unsafeReentrantRead<T>(_ 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<T>(_ block: (Database) throws -> T) rethrows -> T {
|
||||
public func write<T>(_ block: (Database) throws -> T) throws -> T {
|
||||
return try writer.sync { db in
|
||||
var result: T? = nil
|
||||
try db.inTransaction {
|
||||
|
||||
Reference in new issue
Block a user