| Module | Pg_explain |
| In: |
vendor/plugins/pgexplain/lib/pg_explain.rb
|
This module contains:
To setup the configuration options
# File vendor/plugins/pgexplain/lib/pg_explain.rb, line 29
29: def self.configure(options = {})
30: @@color ||= options[:color]
31: @@analyze ||= options[:analyze]
32: end
Disables the plugin
# File vendor/plugins/pgexplain/lib/pg_explain.rb, line 19
19: def self.disable
20: @@enable = false
21: end
Activates the plugin
# File vendor/plugins/pgexplain/lib/pg_explain.rb, line 14
14: def self.enable
15: @@enable = true
16: end
Check if the plugin is enabled
# File vendor/plugins/pgexplain/lib/pg_explain.rb, line 24
24: def self.enabled?
25: @@enable
26: end
Formats the results of the explain query
# File vendor/plugins/pgexplain/lib/pg_explain.rb, line 40
40: def self.format(message)
41: formatted_message = "\n" + message.collect { |line| " " + colorize(line["QUERY PLAN"]) }.join("\n") + "\n"
42: color ? "\033[01;30m#{formatted_message}\033[00m" : formatted_message
43: end