Ruby on Rails/ActiveRecord/Connection adapters

From Wikibooks, open books for an open world
< Ruby on Rails‎ | ActiveRecord
Jump to: navigation, search

ActiveRecord abstracts the connection to the database through connection adapters. It currently supports the following databases:

  • DB2
  • Firebird
  • FrontBase
  • MySQL
  • OpenBase
  • Oracle
  • Postgresql
  • SQL Lite
  • SQL Server
  • Sybase

If you need to access the current connection adapter directly you can do so through the ActiveRecord::Base.connection class method. All connection adapters share some common functionality which is defined in the following source files:

  • active_record/connection_adapters/abstract_adapter.rb
  • active_record/connection_adapters/abstract/connection_specification.rb
  • active_record/connection_adapters/abstract/database_statements.rb
  • active_record/connection_adapters/abstract/quoting.rb
  • active_record/connection_adapters/abstract/schema_definition.rb
  • active_record/connection_adapters/abstract/schema_statements.rb