Class: DB::Context::Transaction

Inherits:
Query
  • Object
show all
Defined in:
lib/db/context/transaction.rb

Instance Attribute Summary

Attributes inherited from Query

#connection

Instance Method Summary collapse

Methods inherited from Query

#call, #close, #flush, #initialize, #next_result, #results, #send_query

Constructor Details

This class inherits a constructor from DB::Context::Query

Instance Method Details

#abortObject



34
35
36
37
# File 'lib/db/context/transaction.rb', line 34

def abort
  self.call("ROLLBACK")
  self.close
end

#commitObject



29
30
31
32
# File 'lib/db/context/transaction.rb', line 29

def commit
  self.call("COMMIT")
  self.close
end

#rollback(name) ⇒ Object



43
44
45
# File 'lib/db/context/transaction.rb', line 43

def rollback(name)
  self.call("ROLLBACK #{name}")
end

#savepoint(name) ⇒ Object



39
40
41
# File 'lib/db/context/transaction.rb', line 39

def savepoint(name)
  self.call("SAVEPOINT #{name}")
end