mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-26 04:07:50 +00:00
Database: a couple more asserts
This commit is contained in:
1 parent
c7f018c635
commit
caea11fbbb
1 file changed
+3
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user