Module: DbAgile::Contract::Connection
- Included in:
- Utils::Full
- Defined in:
- lib/dbagile/contract/connection.rb
Overview
Connection driven methods of the contract
Instance Method Summary collapse
-
#disconnect ⇒ Object
Disconnect the adapter and frees all resources.
-
#physical_schema ⇒ Object
Returns the database schema as a DbAgile::Core::Schema instance.
-
#ping ⇒ Object
Ping the SQL server, returns true if everything is fine.
-
#ping? ⇒ Boolean
Ping the SQL server, returns true if everything is fine, false otherwise.
-
#script2sql(script, buffer = "") ⇒ Object
Converts a schema abstract script to a SQL script.
-
#transaction(&block) ⇒ ...
Yields the block inside a transaction.
Instance Method Details
#disconnect ⇒ Object
Disconnect the adapter and frees all resources.
48 49 50 |
# File 'lib/dbagile/contract/connection.rb', line 48 def disconnect Kernel.raise NotImplementedError end |
#physical_schema ⇒ Object
Returns the database schema as a DbAgile::Core::Schema instance
30 31 32 |
# File 'lib/dbagile/contract/connection.rb', line 30 def physical_schema Kernel.raise NotImplementedError end |
#ping ⇒ Object
Ping the SQL server, returns true if everything is fine. Raises an error otherwise
12 13 14 |
# File 'lib/dbagile/contract/connection.rb', line 12 def ping Kernel.raise NotImplementedError end |
#ping? ⇒ Boolean
Ping the SQL server, returns true if everything is fine, false otherwise.
20 21 22 23 24 25 |
# File 'lib/dbagile/contract/connection.rb', line 20 def ping? ping true rescue StandardError false end |
#script2sql(script, buffer = "") ⇒ Object
Converts a schema abstract script to a SQL script
39 40 41 |
# File 'lib/dbagile/contract/connection.rb', line 39 def script2sql(script, buffer = "") Kernel.raise NotImplementedError end |
#transaction(&block) ⇒ ...
Yields the block inside a transaction.
Adapters are expected to catch the DbAgile::Errors::AbordTransactionError and to rollback the transaction without re-raising the error.
60 61 62 |
# File 'lib/dbagile/contract/connection.rb', line 60 def transaction(&block) Kernel.raise NotImplementedError end |