Module | ActiveRecord::ConnectionAdapters::DatabaseStatements |
In: |
lib/active_record/connection_adapters/abstract/database_statements.rb
|
Appends LIMIT and OFFSET options to a 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
Executes the SQL statement in the context of this connection. This abstract method raises a NotImplementedError.
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 the values of the first column in a select:
select_values("SELECT id FROM companies LIMIT 3") => [1,2,3]