From ff21f8634141d0b41e401bb7b16fb550f166293f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 10 Oct 2019 13:49:12 +0200 Subject: [PATCH] DatabasePool setup: handle #102 in a savepoint --- GRDB/Core/DatabasePool.swift | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/GRDB/Core/DatabasePool.swift b/GRDB/Core/DatabasePool.swift index 0b0a65ae51..c310d92294 100644 --- a/GRDB/Core/DatabasePool.swift +++ b/GRDB/Core/DatabasePool.swift @@ -102,10 +102,13 @@ public final class DatabasePool: DatabaseWriter { // opens a pool to an existing non-WAL database, and // attempts to read from it. // See https://github.com/groue/GRDB.swift/issues/102 - try db.execute(sql: """ - CREATE TABLE grdb_issue_102 (id INTEGER PRIMARY KEY); - DROP TABLE grdb_issue_102; - """) + try db.inSavepoint { + try db.execute(sql: """ + CREATE TABLE grdb_issue_102 (id INTEGER PRIMARY KEY); + DROP TABLE grdb_issue_102; + """) + return .commit + } } } }