Document that empty deferred transactions are not notified

This commit is contained in:
Gwendal Roué committed 2017-10-31 08:46:33 +01:00
1 parent 667e6a8e06
commit 9beb5b553b
1 file changed
+17 -17
+17 -17
View File
@@ -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