mirror of
https://gitea.invidious.io/iv-org/shard-crystal-sqlite3.git
synced 2024-08-15 00:53:26 +00:00
add spec for transactions and nested transactions (#12)
This commit is contained in:
parent
c39220e3f0
commit
46709eab00
2 changed files with 83 additions and 0 deletions
|
@ -33,6 +33,36 @@ class SQLite3::Connection < DB::Connection
|
|||
LibSQLite3.close_v2(self)
|
||||
end
|
||||
|
||||
# :nodoc:
|
||||
def perform_begin_transaction
|
||||
self.prepared.exec "BEGIN"
|
||||
end
|
||||
|
||||
# :nodoc:
|
||||
def perform_commit_transaction
|
||||
self.prepared.exec "COMMIT"
|
||||
end
|
||||
|
||||
# :nodoc:
|
||||
def perform_rollback_transaction
|
||||
self.prepared.exec "ROLLBACK"
|
||||
end
|
||||
|
||||
# :nodoc:
|
||||
def perform_create_savepoint(name)
|
||||
self.prepared.exec "SAVEPOINT #{name}"
|
||||
end
|
||||
|
||||
# :nodoc:
|
||||
def perform_release_savepoint(name)
|
||||
self.prepared.exec "RELEASE SAVEPOINT #{name}"
|
||||
end
|
||||
|
||||
# :nodoc:
|
||||
def perform_rollback_savepoint(name)
|
||||
self.prepared.exec "ROLLBACK TO #{name}"
|
||||
end
|
||||
|
||||
# Dump the database to another SQLite3 database. This can be used for backing up a SQLite3 Database
|
||||
# to disk or the opposite
|
||||
def dump(to : SQLite3::Connection)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue