Skip to content

Commit

Permalink
DatabasePool setup: handle #102 in a savepoint
Browse files Browse the repository at this point in the history
  • Loading branch information
groue committed Oct 10, 2019
1 parent c89d41a commit ff21f86
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions GRDB/Core/DatabasePool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
}
Expand Down

0 comments on commit ff21f86

Please sign in to comment.