instance method
exec_query
Ruby on Rails 6.0.6
Since v4.2.9 Last seen in v6.1.7.10Signature
exec_query(sql, name = "SQL", binds = [], prepare: false)
No documentation comment.
Parameters
-
sqlreq -
nameopt = "SQL" -
bindsopt = [] -
preparekey = false
Source
# File activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb, line 97
def exec_query(sql, name = "SQL", binds = [], prepare: false)
execute_and_clear(sql, name, binds, prepare: prepare) do |result|
types = {}
fields = result.fields
fields.each_with_index do |fname, i|
ftype = result.ftype i
fmod = result.fmod i
types[fname] = get_oid_type(ftype, fmod, fname)
end
ActiveRecord::Result.new(fields, result.values, types)
end
end
Defined in activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb line 97
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements