DatabasePool setup: handle #102 in a savepoint

This commit is contained in:
Gwendal Roué committed 2019-10-10 13:49:12 +02:00
1 parent c89d41adbb
commit ff21f86341
1 file changed
+7 -4
+7 -4
View File
@@ -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
}
}
}
}