Active Record Abstract Adapter
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}[rdoc-ref:ConnectionHandling#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 SchemaStatements are very useful.
Constants
EXTENDED_TYPE_MAPS = Concurrent::Map.new
TYPE_MAP = Type::TypeMap.new.tap { |m| initialize_type_map(m) }
EXCEPTION_IMMEDIATE = { Exception => :immediate }.freeze # :nodoc:
EXCEPTION_NEVER = { Exception => :never }.freeze # :nodoc:
FIBER_LOCK = ActiveSupport::Concurrency::LoadInterlockAwareMonitor.new
THREAD_LOCK = ActiveSupport::Concurrency::ThreadLoadInterlockAwareMonitor.new
DEFAULT_READ_QUERY = [:begin, :commit, :explain, :release, :rollback, :savepoint, :select, :with]
COMMENT_REGEX = %r{(?:--.*\n)|/\*(?:[^*]|\*[^/])*\*/}
SIMPLE_INT = /\A\d+\z/
ADAPTER_NAME = "Abstract"
Attributes
[R] | in_use? | |
[R] | lock | |
[R] | logger | |
[R] | owner | |
[R] | visitor | |
[R] | pool |