Class: ActiveRecord::ConnectionAdapters::SQLite3Adapter::ExplainPrettyPrinter

Inherits:
Object
  • Object
show all
Defined in:
activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb

Instance Method Summary collapse

Instance Method Details

#pp(result) ⇒ Object

Pretty prints the result of a EXPLAIN QUERY PLAN in a way that resembles the output of the SQLite shell:

0|0|0|SEARCH TABLE users USING INTEGER PRIMARY KEY (rowid=?) (~1 rows)
0|1|1|SCAN TABLE posts (~100000 rows)


284
285
286
287
288
# File 'activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb', line 284

def pp(result) # :nodoc:
  result.rows.map do |row|
    row.join('|')
  end.join("\n") + "\n"
end