Class: Rack::Bug::SQLPanel::PanelApp

Inherits:
PanelApp
  • Object
show all
Defined in:
lib/rack/bug/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

Instance Method Details

#dispatchObject



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

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

#execute_sqlObject



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

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

#explain_sqlObject



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

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

#profile_sqlObject



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

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