Methods

Instance Public methods

execute(sql, name = nil, async: false)

Executes the SQL statement in the context of this connection.

# File activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb, line 41
def execute(sql, name = nil, async: false)
  sql = transform_query(sql)
  check_if_write_query(sql)

  raw_execute(sql, name, async: async)
end

explain(arel, binds = [])

# File activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb, line 31
def explain(arel, binds = [])
  sql     = "EXPLAIN #{to_sql(arel, binds)}"
  start   = Concurrent.monotonic_time
  result  = exec_query(sql, "EXPLAIN", binds)
  elapsed = Concurrent.monotonic_time - start

  MySQL::ExplainPrettyPrinter.new.pp(result, elapsed)
end

high_precision_current_timestamp()

# File activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb, line 84
def high_precision_current_timestamp
  HIGH_PRECISION_CURRENT_TIMESTAMP
end