class

ActiveRecord::ConnectionAdapters::AbstractAdapter

rails latest stable - Superclass: Object

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.

Included modules

  • ActiveRecord::ConnectionAdapters::DatabaseLimits
  • ActiveRecord::ConnectionAdapters::DatabaseStatements
  • ActiveRecord::ConnectionAdapters::QueryCache
  • ActiveRecord::ConnectionAdapters::Quoting
  • ActiveRecord::ConnectionAdapters::Savepoints
  • ActiveRecord::ConnectionAdapters::SchemaStatements
  • ActiveSupport::Callbacks

Constants

ADAPTER_NAME = "Abstract"

COMMENT_REGEX = %r{(?:--.*\\n)|/\\*(?:[^*]|\\*[^/])*\\*/}

DEFAULT_READ_QUERY = [:begin, :commit, :explain, :release, :rollback, :savepoint, :select, :with]

EXCEPTION_IMMEDIATE = { Exception => :immediate }.freeze # :nodoc:

EXCEPTION_NEVER = { Exception => :never }.freeze # :nodoc:

EXTENDED_TYPE_MAPS = Concurrent::Map.new

FIBER_LOCK = ActiveSupport::Concurrency::LoadInterlockAwareMonitor.new

SIMPLE_INT = /\\A\\d+\\z/

THREAD_LOCK = ActiveSupport::Concurrency::ThreadLoadInterlockAwareMonitor.new

TYPE_MAP = Type::TypeMap.new.tap { |m| initialize_type_map(m) }

Attributes

[R]in_use?
[R]lock
[R]logger
[R]owner
[R]pool
[R]visitor

Files

  • activerecord/lib/active_record/connection_adapters/abstract_adapter.rb