Class: ActiveRecordADBCAdapter::Adapter::Connection
- Inherits:
-
Object
- Object
- ActiveRecordADBCAdapter::Adapter::Connection
- Defined in:
- lib/activerecord_adbc_adapter/adapter.rb
Instance Method Summary collapse
- #close ⇒ Object
-
#get_objects(depth: :all, catalog: nil, db_schema: nil, table_name: nil, table_types: nil, column_name: nil) ⇒ Object
red-adbc provides convenient wrapper.
-
#initialize(**params) ⇒ Connection
constructor
A new instance of Connection.
- #open_statement(&block) ⇒ Object
- #reconnect ⇒ Object
Constructor Details
#initialize(**params) ⇒ Connection
Returns a new instance of Connection.
24 25 26 27 28 |
# File 'lib/activerecord_adbc_adapter/adapter.rb', line 24 def initialize(**params) params.delete(:database_tasks) @database = ADBC::Database.open(**params) @connection = @database.connect end |
Instance Method Details
#close ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/activerecord_adbc_adapter/adapter.rb', line 30 def close if @connection @connection.release @connection = nil end @database.release @database = nil end |
#get_objects(depth: :all, catalog: nil, db_schema: nil, table_name: nil, table_types: nil, column_name: nil) ⇒ Object
red-adbc provides convenient wrapper
52 53 54 |
# File 'lib/activerecord_adbc_adapter/adapter.rb', line 52 def get_objects(...) @connection.get_objects(...) end |
#open_statement(&block) ⇒ Object
46 47 48 |
# File 'lib/activerecord_adbc_adapter/adapter.rb', line 46 def open_statement(&block) @connection.open_statement(&block) end |
#reconnect ⇒ Object
39 40 41 42 43 44 |
# File 'lib/activerecord_adbc_adapter/adapter.rb', line 39 def reconnect if @connection @connection.release @connection = @database.connect end end |