Module ActiveRecord::ConnectionAdapters::DatabaseStatements
In: lib/active_record/connection_adapters/abstract/database_statements.rb

Methods

Public Instance methods

Appends LIMIT and OFFSET options to a SQL statement. This method modifies the sql parameter.

Examples
 add_limit_offset!('SELECT * FROM suppliers', {:limit => 10, :offset => 50})

generates

 SELECT * FROM suppliers LIMIT 10 OFFSET 50

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

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

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

Executes the SQL statement in the context of this connection. This abstract method raises a NotImplementedError.

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

Set the sequence to the max value of the table’s column.

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

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

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

Returns a single value from a record

Returns an array of the values of the first column in a select:

  select_values("SELECT id FROM companies LIMIT 3") => [1,2,3]

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

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

[Validate]