mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-24 04:07:47 +00:00
Document that empty deferred transactions are not notified
This commit is contained in:
1 parent
667e6a8e06
commit
9beb5b553b
1 file changed
+17
-17
@@ -4498,16 +4498,16 @@ try dbQueue.inTransaction { db in
|
||||
|
||||
> :point_up: **Note**: for SQLite, empty deferred transactions are no transaction at all. In this case, the transaction callback is never executed:
|
||||
>
|
||||
> ```swift
|
||||
> // Empty deferred transaction
|
||||
> dbQueue.inTransaction { db in
|
||||
> db.afterNextTransactionCommit { db in
|
||||
> // Never executed
|
||||
> print("success")
|
||||
> }
|
||||
> return .commit
|
||||
> ```swift
|
||||
> // Empty deferred transaction
|
||||
> dbQueue.inTransaction { db in
|
||||
> db.afterNextTransactionCommit { db in
|
||||
> // Never executed
|
||||
> print("success")
|
||||
> }
|
||||
> ```
|
||||
> return .commit
|
||||
> }
|
||||
> ```
|
||||
|
||||
|
||||
### TransactionObserver Protocol
|
||||
@@ -4729,14 +4729,14 @@ dbQueue.inDatabase { db in
|
||||
|
||||
> :point_up: **Note**: for SQLite, empty deferred transactions are no transaction at all. In this case, an observer added with the `.nextTransaction` extent is never notified of any transaction:
|
||||
>
|
||||
> ```swift
|
||||
> // Empty deferred transaction
|
||||
> dbQueue.inTransaction { db in
|
||||
> // Observer is never notified of any transaction
|
||||
> db.add(transactionObserver: observer, extent: .nextTransaction)
|
||||
> return .commit
|
||||
> }
|
||||
> ```
|
||||
> ```swift
|
||||
> // Empty deferred transaction
|
||||
> dbQueue.inTransaction { db in
|
||||
> // Observer is never notified of any transaction
|
||||
> db.add(transactionObserver: observer, extent: .nextTransaction)
|
||||
> return .commit
|
||||
> }
|
||||
> ```
|
||||
|
||||
#### Support for SQLite Pre-Update Hooks
|
||||
|
||||
|
||||
Reference in new issue
Block a user