Skip to content

Instance Method

withRollbackObserver(_:body:)

Execute a block with a temporary rollback observer.
func withRollbackObserver<T>(_ callback: @escaping SQLiteConnection.SQLiteRollbackHookCallback, body: () async throws -> T) async throws -> T

Parameters

callback

The observer callback to register temporarily.

body

The block to execute with the observer active.

Return Value

The return value of the body block.

Discussion

The observer is automatically removed when the block completes.

Throws

Any error thrown by the body block.