Class: ROM::SQL::Adapter
- Inherits:
-
Adapter
- Object
- Adapter
- ROM::SQL::Adapter
- Defined in:
- lib/rom/sql/adapter.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
Class Method Summary collapse
Instance Method Summary collapse
- #[](name) ⇒ Object
- #command_namespace ⇒ Object
- #dataset?(name) ⇒ Boolean
- #extend_relation_class(klass) ⇒ Object
- #extend_relation_instance(relation) ⇒ Object
-
#initialize(*args) ⇒ Adapter
constructor
A new instance of Adapter.
- #schema ⇒ Object
Constructor Details
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
9 10 11 |
# File 'lib/rom/sql/adapter.rb', line 9 def logger @logger end |
Class Method Details
.schemes ⇒ Object
11 12 13 14 15 |
# File 'lib/rom/sql/adapter.rb', line 11 def self.schemes [:ado, :amalgalite, :cubrid, :db2, :dbi, :do, :fdbsql, :firebird, :ibmdb, :informix, :jdbc, :mysql, :mysql2, :odbc, :openbase, :oracle, :postgres, :sqlanywhere, :sqlite, :swift, :tinytds] end |
Instance Method Details
#[](name) ⇒ Object
22 23 24 |
# File 'lib/rom/sql/adapter.rb', line 22 def [](name) connection[name] end |
#command_namespace ⇒ Object
47 48 49 |
# File 'lib/rom/sql/adapter.rb', line 47 def command_namespace SQL::Commands end |
#dataset?(name) ⇒ Boolean
35 36 37 |
# File 'lib/rom/sql/adapter.rb', line 35 def dataset?(name) tables.include?(name) end |
#extend_relation_class(klass) ⇒ Object
39 40 41 |
# File 'lib/rom/sql/adapter.rb', line 39 def extend_relation_class(klass) klass.send(:include, RelationInclusion) end |
#extend_relation_instance(relation) ⇒ Object
43 44 45 |
# File 'lib/rom/sql/adapter.rb', line 43 def extend_relation_instance(relation) relation.extend(RelationExtension) end |
#schema ⇒ Object
31 32 33 |
# File 'lib/rom/sql/adapter.rb', line 31 def schema tables.map { |table| [table, dataset(table), columns(table)] } end |