From a9a06a0652ea0634ef653f85dd2756bbe20a7d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 28 Apr 2016 08:35:55 +0200 Subject: [PATCH] README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bd517f3e0..95fb9037b 100644 --- a/README.md +++ b/README.md @@ -2256,8 +2256,10 @@ try dbQueue.inTransaction { db in Database statements that are executed outside of an explicit transaction do not drop off the radar: ```swift -try db.execute("INSERT ...") // 1. didChange, 2. willCommit, 3. didCommit -try db.execute("UPDATE ...") // 4. didChange, 5. willCommit, 6. didCommit +try dbQueue.inDatabase { db in + try db.execute("INSERT ...") // 1. didChange, 2. willCommit, 3. didCommit + try db.execute("UPDATE ...") // 4. didChange, 5. willCommit, 6. didCommit +} ``` **Eventual errors** thrown from `databaseWillCommit` are exposed to the application code: