Module: DbAgile::SequelAdapter::Connection
- Included in:
- DbAgile::SequelAdapter
- Defined in:
- lib/dbagile/adapter/sequel/connection.rb
Instance Method Summary collapse
- #disconnect ⇒ Object
- #physical_schema ⇒ Object
- #ping ⇒ Object
- #script2sql(script, buffer = "") ⇒ Object
- #transaction(&block) ⇒ Object
Instance Method Details
#disconnect ⇒ Object
11 12 13 14 |
# File 'lib/dbagile/adapter/sequel/connection.rb', line 11 def disconnect @db.disconnect if @db true end |
#physical_schema ⇒ Object
17 18 19 |
# File 'lib/dbagile/adapter/sequel/connection.rb', line 17 def physical_schema SequelAdapter::Schema::PhysicalDump.new.run(db, uri) end |
#ping ⇒ Object
6 7 8 |
# File 'lib/dbagile/adapter/sequel/connection.rb', line 6 def ping db.test_connection end |
#script2sql(script, buffer = "") ⇒ Object
22 23 24 |
# File 'lib/dbagile/adapter/sequel/connection.rb', line 22 def script2sql(script, buffer = "") SequelAdapter::Schema::ConcreteScript::script2sql(db, script, buffer) end |
#transaction(&block) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/dbagile/adapter/sequel/connection.rb', line 27 def transaction(&block) raise ArgumentError, "Missing transaction block" unless block begin db.transaction{ block.call(self) } rescue DbAgile::AbordTransactionError nil end end |