Skip to Content Skip to Search
v7.1.0
module ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements
Methods
B
E
H
R

Public instance methods

build_explain_clause(options = [])

Permalink
Source code GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb, line 129
def build_explain_clause(options = [])
  return "EXPLAIN" if options.empty?

  "EXPLAIN (#{options.join(", ").upcase})"
end

explain(arel, binds = [], options = [])

Permalink
Source code GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb, line 7
def explain(arel, binds = [], options = [])
  sql    = build_explain_clause(options) + " " + to_sql(arel, binds)
  result = internal_exec_query(sql, "EXPLAIN", binds)
  PostgreSQL::ExplainPrettyPrinter.new.pp(result)
end

high_precision_current_timestamp()

Permalink
Source code GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb, line 125
def high_precision_current_timestamp
  HIGH_PRECISION_CURRENT_TIMESTAMP
end

raw_execute(sql, name, async: false, allow_retry: false, materialize_transactions: true)

Permalink
Source code GitHub
# File activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb, line 50
def raw_execute(sql, name, async: false, allow_retry: false, materialize_transactions: true)
  log(sql, name, async: async) do
    with_raw_connection(allow_retry: allow_retry, materialize_transactions: materialize_transactions) do |conn|
      result = conn.async_exec(sql)
      handle_warnings(result)
      result
    end
  end
end
Definition files