instance method
exec_query
Ruby on Rails 3.2.22.5
Since v3.1.12 Last seen in v4.2.9Signature
exec_query(sql, name = 'SQL', binds = [])
No documentation comment.
Parameters
-
sqlreq -
nameopt = 'SQL' -
bindsopt = []
Source
# File activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 284
def exec_query(sql, name = 'SQL', binds = [])
# If the configuration sets prepared_statements:false, binds will
# always be empty, since the bind variables will have been already
# substituted and removed from binds by BindVisitor, so this will
# effectively disable prepared statement usage completely.
if binds.empty?
result_set, affected_rows = exec_without_stmt(sql, name)
else
result_set, affected_rows = exec_stmt(sql, name, binds)
end
yield affected_rows if block_given?
result_set
end
Defined in activerecord/lib/active_record/connection_adapters/mysql_adapter.rb line 284
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Mysql::Stmt::ActiveRecord::ConnectionAdapters::MysqlAdapter