Class: Libsql::Transaction
- Inherits:
-
Object
- Object
- Libsql::Transaction
- Includes:
- Prepareable
- Defined in:
- lib/libsql.rb
Instance Method Summary collapse
- #commit ⇒ Object
- #execute_batch(sql) ⇒ Object
-
#initialize(inner) ⇒ Transaction
constructor
A new instance of Transaction.
- #prepare(sql) ⇒ Object
- #rollback ⇒ Object
Methods included from Prepareable
Constructor Details
#initialize(inner) ⇒ Transaction
Returns a new instance of Transaction.
355 356 357 |
# File 'lib/libsql.rb', line 355 def initialize(inner) @inner = inner end |
Instance Method Details
#commit ⇒ Object
369 |
# File 'lib/libsql.rb', line 369 def commit = @inner.commit |
#execute_batch(sql) ⇒ Object
366 |
# File 'lib/libsql.rb', line 366 def execute_batch(sql) = @inner.execute_batch(sql) |
#prepare(sql) ⇒ Object
359 360 361 362 363 364 |
# File 'lib/libsql.rb', line 359 def prepare(sql) stmt = Statement.new @inner.prepare sql return stmt unless block_given? begin yield stmt ensure stmt.close end end |
#rollback ⇒ Object
368 |
# File 'lib/libsql.rb', line 368 def rollback = @inner.rollback |