Module: ArJdbc::PostgreSQL::DatabaseStatements
- Included in:
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
- Defined in:
- lib/arjdbc/postgresql/database_statements.rb
Instance Method Summary collapse
Instance Method Details
#build_explain_clause(options = []) ⇒ Object
13 14 15 16 17 |
# File 'lib/arjdbc/postgresql/database_statements.rb', line 13 def build_explain_clause( = []) return "EXPLAIN" if .empty? "EXPLAIN (#{.join(", ").upcase})" end |
#explain(arel, binds = [], options = []) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/arjdbc/postgresql/database_statements.rb', line 6 def explain(arel, binds = [], = []) sql = build_explain_clause() + " " + to_sql(arel, binds) result = internal_exec_query(sql, "EXPLAIN", binds) ActiveRecord::ConnectionAdapters::PostgreSQL::ExplainPrettyPrinter.new.pp(result) end |