Database: a couple more asserts

This commit is contained in:
Gwendal Roué committed 2018-06-04 11:58:40 +02:00
1 parent c7f018c635
commit caea11fbbb
1 file changed
+3
+3
View File
@@ -670,6 +670,7 @@ extension Database {
switch completion {
case .commit:
try execute("RELEASE SAVEPOINT grdb")
assert(!topLevelSavepoint || !isInsideTransaction)
needsRollback = false
case .rollback:
needsRollback = true
@@ -759,11 +760,13 @@ extension Database {
if sqlite3_get_autocommit(sqliteConnection) == 0 {
try execute("ROLLBACK TRANSACTION")
}
assert(!isInsideTransaction)
}
/// Commits a database transaction.
public func commit() throws {
try execute("COMMIT TRANSACTION")
assert(!isInsideTransaction)
}
}