Class: LLMDB::Connection
- Inherits:
-
Object
- Object
- LLMDB::Connection
- Defined in:
- lib/llmdb/connection.rb
Instance Method Summary collapse
- #execute(sql) ⇒ Object
-
#initialize(config) ⇒ Connection
constructor
A new instance of Connection.
- #table_schema(table_name) ⇒ Object
- #tables ⇒ Object
Constructor Details
#initialize(config) ⇒ Connection
Returns a new instance of Connection.
3 4 5 6 |
# File 'lib/llmdb/connection.rb', line 3 def initialize(config) @config = config @adapter = build_adapter(config) end |
Instance Method Details
#execute(sql) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/llmdb/connection.rb', line 16 def execute(sql) @adapter.execute( sql, permission_mode: @config., confirm: @config.confirm_callback, classifier: @config.write_classifier, max_rows: @config.max_rows ) end |
#table_schema(table_name) ⇒ Object
12 13 14 |
# File 'lib/llmdb/connection.rb', line 12 def table_schema(table_name) @adapter.table_schema(table_name) end |
#tables ⇒ Object
8 9 10 |
# File 'lib/llmdb/connection.rb', line 8 def tables @adapter.tables end |