mirror of
https://gitea.invidious.io/iv-org/shard-crystal-db.git
synced 2024-08-15 00:53:32 +00:00
Transactions
* dsl, state checks * define transaction sql commands in connection
This commit is contained in:
parent
1049d95562
commit
751f8b26ac
9 changed files with 293 additions and 1 deletions
|
@ -42,11 +42,34 @@ class DummyDriver < DB::Driver
|
|||
@connected = false
|
||||
end
|
||||
|
||||
def create_transaction
|
||||
DummyTransaction.new(self)
|
||||
end
|
||||
|
||||
protected def do_close
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
class DummyTransaction < DB::TopLevelTransaction
|
||||
getter committed = false
|
||||
getter rolledback = false
|
||||
|
||||
def initialize(connection)
|
||||
super(connection)
|
||||
end
|
||||
|
||||
def commit
|
||||
super
|
||||
@committed = true
|
||||
end
|
||||
|
||||
def rollback
|
||||
super
|
||||
@rolledback = true
|
||||
end
|
||||
end
|
||||
|
||||
class DummyStatement < DB::Statement
|
||||
property params
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue