From 15600b726898cf660d5373498db97ff2499a2ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 13 Sep 2015 17:37:02 +0200 Subject: [PATCH] Documentation: remove warnings about Database extraction out of DatabaseQueue, since Database will vigorously crash as soon as it is badly used. --- GRDB/Core/DatabaseQueue.swift | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/GRDB/Core/DatabaseQueue.swift b/GRDB/Core/DatabaseQueue.swift index 32ed963e4..21652dcdc 100644 --- a/GRDB/Core/DatabaseQueue.swift +++ b/GRDB/Core/DatabaseQueue.swift @@ -70,16 +70,6 @@ public final class DatabaseQueue { This method is *not* reentrant. - **Warning**: The *db* parameter of the block should not be used outside of - the block. Do not extract it, and do not store it in another object that - lives longer than the block: - - var database: Database? - dbQueue.inDatabase { db in - database = db - } - database!.fetch(...) // NOT OK - - parameter block: A block that accesses the database. - throws: The error thrown by the block. */ @@ -98,17 +88,6 @@ public final class DatabaseQueue { This method is *not* reentrant. - **Warning**: The *db* parameter of the block should not be used outside of - the block. Do not extract it, and do not store it in another object that - lives longer than the block: - - var database: Database? - let rows = dbQueue.inDatabase { db in - database = db - return db.fetch(...) - } - database!.fetch(...) // NOT OK - - parameter block: A block that accesses the database. - throws: The error thrown by the block. */ @@ -132,16 +111,6 @@ public final class DatabaseQueue { This method is *not* reentrant. - **Warning**: The *db* parameter of the block should not be used outside of - the transaction block. Do not extract it, and do not store it in another - object that lives longer than the block: - - var database: Database? - try dbQueue.inTransaction { db in - database = db - } - database!.fetch(...) // NOT OK - - parameter type: The transaction type (default nil). If nil, the transaction type is configuration.transactionType, which itself defaults to .Exclusive. See https://www.sqlite.org/lang_transaction.html for more