instance method
select_rows
Ruby on Rails 5.0.7.2
Since v4.2.11.3 Last seen in v5.0.7.2Available in: v4.2.11.3 v5.0.7.2
Signature
select_rows(sql, name = nil, binds = [])
Executes a SELECT query and returns an array of rows. Each row is an array of field values.
Parameters
-
sqlreq -
nameopt = nil -
bindsopt = []
Source
# File activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb, line 32
def select_rows(sql, name = nil, binds = [])
execute_and_clear(sql, name, binds) do |result|
result.values
end
end
Defined in activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb line 32
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements