Module: ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb |
Constant Summary
-
IDLE_TRANSACTION_STATUSES =
private
# File 'activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb', line 139[PG::PQTRANS_IDLE, PG::PQTRANS_INTRANS, PG::PQTRANS_INERROR]
Instance Method Summary
Instance Method Details
#build_explain_clause(options = [])
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb', line 132
def build_explain_clause( = []) return "EXPLAIN" if .empty? "EXPLAIN (#{ .join(", ").upcase})" end
#exec_update(sql, name = nil, binds = [])
Alias for #exec_delete.
# File 'activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb', line 79
alias :exec_update :exec_delete
#explain(arel, binds = [], options = [])
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb', line 7
def explain(arel, binds = [], = []) sql = build_explain_clause( ) + " " + to_sql(arel, binds) result = internal_exec_query(sql, "EXPLAIN", binds) PostgreSQL::ExplainPrettyPrinter.new.pp(result) end
#high_precision_current_timestamp
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb', line 128
def HIGH_PRECISION_CURRENT_TIMESTAMP end
#raw_execute(sql, name, async: false, allow_retry: false, materialize_transactions: true)
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb', line 52
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) verified! handle_warnings(result) result end end end