method

exec_query

Importance_0
v6.0.0 - Show latest stable - 0 notes - Class: DatabaseStatements
exec_query(sql, name = "SQL", binds = [], prepare: false) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb, line 42
        def exec_query(sql, name = "SQL", binds = [], prepare: false)
          if without_prepared_statement?(binds)
            execute_and_free(sql, name) do |result|
              if result
                ActiveRecord::Result.new(result.fields, result.to_a)
              else
                ActiveRecord::Result.new([], [])
              end
            end
          else
            exec_stmt_and_free(sql, name, binds, cache_stmt: prepare) do |_, result|
              if result
                ActiveRecord::Result.new(result.fields, result.to_a)
              else
                ActiveRecord::Result.new([], [])
              end
            end
          end
        end
Register or log in to add new notes.