All the concrete database adapters follow the interface laid down in this class. You can use this interface directly by borrowing the database connection from the Base with Base.connection.
Most of the methods in the adapter are useful during migrations. Most notably, SchemaStatements#create_table, SchemaStatements#drop_table, SchemaStatements#add_index, SchemaStatements#remove_index, SchemaStatements#add_column, SchemaStatements#change_column and SchemaStatements#remove_column are very useful.
Is this connection active and ready to perform queries?
[ show source ]
# File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 59
59: def active?
60: true
61: end
Returns the human-readable name of the adapter. Use mixed case - one can always use downcase if needed.
[ show source ]
# File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 32
32: def adapter_name
33: 'Abstract'
34: end
Should primary key values be selected from their corresponding sequence before the insert statement? If true, next_sequence_value is called before each insert to set the record’s primary key. This is false for all adapters but Firebird.
[ show source ]
# File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 46
46: def prefetch_primary_key?(table_name = nil)
47: false
48: end
Close this connection and open a new one in its place.
[ show source ]
# File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 64
64: def reconnect!
65: end
Does this adapter support migrations? Backend specific, as the abstract adapter always returns false.
[ show source ]
# File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 38
38: def supports_migrations?
39: false
40: end