method

exec_query

Importance_0
v7.0.0 - Show latest stable - 0 notes - Class: DatabaseStatements
exec_query(sql, name = "SQL", binds = [], prepare: false, async: 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 50
        def exec_query(sql, name = "SQL", binds = [], prepare: false, async: false) # :nodoc:
          if without_prepared_statement?(binds)
            execute_and_free(sql, name, async: async) do |result|
              if result
                build_result(columns: result.fields, rows: result.to_a)
              else
                build_result(columns: [], rows: [])
              end
            end
          else
            exec_stmt_and_free(sql, name, binds, cache_stmt: prepare, async: async) do |_, result|
              if result
                build_result(columns: result.fields, rows: result.to_a)
              else
                build_result(columns: [], rows: [])
              end
            end
          end
        end
Register or log in to add new notes.