Module: DbAgile::SequelAdapter::Connection

Included in:
DbAgile::SequelAdapter
Defined in:
lib/dbagile/adapter/sequel/connection.rb

Instance Method Summary collapse

Instance Method Details

#disconnectObject



11
12
13
14
# File 'lib/dbagile/adapter/sequel/connection.rb', line 11

def disconnect
  @db.disconnect if @db
  true
end

#physical_schemaObject



17
18
19
# File 'lib/dbagile/adapter/sequel/connection.rb', line 17

def physical_schema
  SequelAdapter::Schema::PhysicalDump.new.run(db, uri)
end

#pingObject



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

Raises:

  • (ArgumentError)

See Also:



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