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.

Methods
Included Modules
Public Instance methods
adapter_name()

Returns the human-readable name of the adapter. Use mixed case - one can always use downcase if needed.

     # File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 348
348:       def adapter_name()
349:         'Abstract'
350:       end
add_column(table_name, column_name, type, options = {})
     # File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 391
391:       def add_column(table_name, column_name, type, options = {})
392:         native_type = native_database_types[type]
393:         add_column_sql = "ALTER TABLE #{table_name} ADD #{column_name} #{native_type[:name]}"
394:         add_column_sql << "(#{options[:limit] || native_type[:limit]})" if options[:limit] || native_type[:limit]
395:         add_column_sql << " DEFAULT '#{options[:default]}'" if options[:default]
396:         execute(add_column_sql)
397:       end
add_limit!(sql, limit)
     # File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 355
355:       def add_limit!(sql, limit)
356:         if limit.is_a? Array
357:           limit, offset = *limit
358:           add_limit_with_offset!(sql, limit.to_i, offset.to_i)
359:         else
360:           add_limit_without_offset!(sql, limit)
361:         end
362:       end
add_limit_with_offset!(sql, limit, offset)
     # File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 364
364:       def add_limit_with_offset!(sql, limit, offset)
365:         sql << " LIMIT #{limit} OFFSET #{offset}"
366:       end
add_limit_without_offset!(sql, limit)
     # File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 368
368:       def add_limit_without_offset!(sql, limit)
369:         sql << " LIMIT #{limit}"
370:       end
begin_db_transaction()

Begins the transaction (and turns off auto-committing).

     # File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 312
312:       def begin_db_transaction()    end
columns(table_name, name = nil)

Returns an array of column objects for the table specified by table_name.

     # File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 279
279:       def columns(table_name, name = nil) end
commit_db_transaction()

Commits the transaction (and turns on auto-committing).

     # File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 315
315:       def commit_db_transaction()   end
create_table(name, options = "") {|TableDefinition.new| ...}
     # File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 381
381:       def create_table(name, options = "")
382:         execute "CREATE TABLE #{name} (id #{native_database_types[:primary_key]}) #{options}"
383:         table_definition = yield TableDefinition.new
384:         table_definition.columns.each { |column_name, type, options| add_column(name, column_name, type, options) }
385:       end
delete(sql, name = nil)

Executes the delete statement and returns the number of rows affected.

     # File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 288
288:       def delete(sql, name = nil) end
drop_table(name)
     # File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 387
387:       def drop_table(name)
388:         execute "DROP TABLE #{name}"
389:       end
initialize_schema_information()
     # File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 372
372:       def initialize_schema_information
373:         begin
374:           execute "CREATE TABLE schema_info (version #{native_database_types[:integer][:name]}#{native_database_types[:integer][:limit]})"
375:           insert "INSERT INTO schema_info (version) VALUES(0)"
376:         rescue ActiveRecord::StatementInvalid
377:           # Schema has been intialized
378:         end
379:       end
insert(sql, name = nil, pk = nil, id_value = nil)

Returns the last auto-generated ID from the affected table.

     # File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 282
282:       def insert(sql, name = nil, pk = nil, id_value = nil) end
quote(value, column = nil)
     # File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 321
321:       def quote(value, column = nil)
322:         case value
323:           when String                
324:             if column && column.type == :binary
325:               "'#{quote_string(column.string_to_binary(value))}'" # ' (for ruby-mode)
326:             else
327:               "'#{quote_string(value)}'" # ' (for ruby-mode)
328:             end
329:           when NilClass              then "NULL"
330:           when TrueClass             then (column && column.type == :boolean ? "'t'" : "1")
331:           when FalseClass            then (column && column.type == :boolean ? "'f'" : "0")
332:           when Float, Fixnum, Bignum then value.to_s
333:           when Date                  then "'#{value.to_s}'" 
334:           when Time, DateTime        then "'#{value.strftime("%Y-%m-%d %H:%M:%S")}'"
335:           else                            "'#{quote_string(value.to_yaml)}'"
336:         end
337:       end
quote_column_name(name)
     # File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 343
343:       def quote_column_name(name)
344:         name
345:       end
quote_string(s)
     # File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 339
339:       def quote_string(s)
340:         s.gsub(/\\/, '\&\&').gsub(/'/, "''") # ' (for ruby-mode)
341:       end
remove_column(table_name, column_name)
     # File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 399
399:       def remove_column(table_name, column_name)
400:         execute "ALTER TABLE #{table_name} DROP #{column_name}"
401:       end
rollback_db_transaction()

Rolls back the transaction (and turns on auto-committing). Must be done if the transaction block raises an exception or returns false.

     # File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 319
319:       def rollback_db_transaction() end
select_all(sql, name = nil)

Returns an array of record hashes with the column names as a keys and fields as values.

     # File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 273
273:       def select_all(sql, name = nil) end
select_one(sql, name = nil)

Returns a record hash with the column names as a keys and fields as values.

     # File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 276
276:       def select_one(sql, name = nil) end
structure_dump()

Returns a string of the CREATE TABLE SQL statements for recreating the entire structure of the database.

     # File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 353
353:       def structure_dump() end
transaction(start_db_transaction = true) {|| ...}

Wrap a block in a transaction. Returns result of block.

     # File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 297
297:       def transaction(start_db_transaction = true)
298:         begin
299:           if block_given?
300:             begin_db_transaction if start_db_transaction
301:             result = yield
302:             commit_db_transaction if start_db_transaction
303:             result
304:           end
305:         rescue Exception => database_transaction_rollback
306:           rollback_db_transaction if start_db_transaction
307:           raise
308:         end
309:       end
update(sql, name = nil)

Executes the update statement and returns the number of rows affected.

     # File vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 285
285:       def update(sql, name = nil) end