Module | ActiveRecord::ConnectionAdapters::DatabaseStatements |
In: |
lib/active_record/connection_adapters/abstract/database_statements.rb
|
Appends LIMIT and OFFSET options to an SQL statement. This method modifies the sql parameter.
add_limit_offset!('SELECT * FROM suppliers', {:limit => 10, :offset => 50})
generates
SELECT * FROM suppliers LIMIT 10 OFFSET 50
Appends a locking clause to an SQL statement. This method modifies the sql parameter.
# SELECT * FROM suppliers FOR UPDATE add_lock! 'SELECT * FROM suppliers', :lock => true add_lock! 'SELECT * FROM suppliers', :lock => ' FOR UPDATE'
Inserts the given fixture into the table. Overridden in adapters that require something beyond a simple insert (eg. Oracle).
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 arrays containing the field values. Order is the same as that returned by columns.
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.