Active Record supports multiple database systems. AbstractAdapter and related classes form the abstraction layer which makes this possible. An AbstractAdapter represents a connection to a database, and provides an abstract interface for database-specific functionality such as establishing a connection, escaping values, building the right SQL fragments for ‘:offset’ and ‘:limit’ options, etc.

All the concrete database adapters follow the interface laid down in this class. ActiveRecord::Base.connection returns an AbstractAdapter object, which you can use.

Most of the methods in the adapter are useful during migrations. Most notably, the instance methods provided by SchemaStatement are very useful.


ADAPTER_NAME = 'Abstract'.freeze

SIMPLE_INT = /\A\d+\z/


[R] prepared_statements
[RW] visitor
[RW] pool
[R] schema_cache
[R] owner
[R] logger
[R] in_use?
Show files where this class is defined (2 files)
Register or log in to add new notes.