Class: Rack::Insight::SQLPanel::PanelApp

Inherits:
PanelApp
  • Object
show all
Defined in:
lib/rack/insight/panels/sql_panel/panel_app.rb

Instance Attribute Summary

Attributes inherited from PanelApp

#request

Instance Method Summary collapse

Methods inherited from PanelApp

#call, #not_found, #params, #render_template, #validate_params

Methods included from Render

#compile, #compile!, #compiled_source, #method_name, #method_name_without_locals, #render_template, #signed_params

Methods included from Logging

logger, verbose, verbosity

Instance Method Details

#dispatchObject



8
9
10
11
12
13
14
15
# File 'lib/rack/insight/panels/sql_panel/panel_app.rb', line 8

def dispatch
  case request.path_info
  when "/explain" then explain_sql
  when "/profile" then profile_sql
  when "/execute" then execute_sql
  else not_found
  end
end

#execute_sqlObject



29
30
31
32
33
# File 'lib/rack/insight/panels/sql_panel/panel_app.rb', line 29

def execute_sql
  validate_params
  query = QueryResult.new(params["query"], params["time"].to_f)
  render_template "panels/execute_sql", :query => query
end

#explain_sqlObject



17
18
19
20
21
# File 'lib/rack/insight/panels/sql_panel/panel_app.rb', line 17

def explain_sql
  validate_params
  query = ExplainResult.new(params["query"], params["time"].to_f)
  render_template "panels/explain_sql", :query => query
end

#profile_sqlObject



23
24
25
26
27
# File 'lib/rack/insight/panels/sql_panel/panel_app.rb', line 23

def profile_sql
  validate_params
  query = ProfileResult.new(params["query"], params["time"].to_f)
  render_template "panels/profile_sql", :query => query
end