Class: RailsConsolePro::Printers::ExplainPrinter

Inherits:
BasePrinter
  • Object
show all
Defined in:
lib/rails_console_pro/printers/explain_printer.rb

Overview

Printer for SQL explain results

Constant Summary collapse

SCAN_PATTERNS =
{
  'Seq Scan' => { color: :red, icon: '⚠️' },
  'Index Scan' => { color: :green, icon: '✅' },
  'Index Only Scan' => { color: :green, icon: '✅' },
  'Hash Join' => { color: :yellow, icon: '🔄' },
  'Nested Loop' => { color: :yellow, icon: '🔄' },
  'Sort' => { color: :cyan, icon: '📑' }
}.freeze

Instance Attribute Summary

Attributes inherited from BasePrinter

#output, #pry_instance, #value

Instance Method Summary collapse

Methods inherited from BasePrinter

#initialize

Methods included from ColorHelper

#bold_color, #color, #method_missing, #pastel, #respond_to_missing?

Constructor Details

This class inherits a constructor from RailsConsolePro::BasePrinter

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RailsConsolePro::ColorHelper

Instance Method Details



16
17
18
19
20
21
22
23
24
25
# File 'lib/rails_console_pro/printers/explain_printer.rb', line 16

def print
  print_header
  print_query
  print_execution_time
  print_query_plan
  print_index_analysis
  print_recommendations
  print_statistics
  print_footer
end