query_reviewer 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.md +20 -6
  2. data/lib/query_reviewer.rb +6 -1
  3. metadata +6 -6
data/README.md CHANGED
@@ -9,9 +9,11 @@ QueryReviewer is an advanced SQL query analyzer. It accomplishes the following
9
9
  * Attach meaningful warnings to individual queries, and collections of queries
10
10
  * Display interactive summary on page
11
11
 
12
- ## This Fork ##
12
+ ## Use This Fork ##
13
13
 
14
- I use this utility for most of my rails projects. Still the best out there in my opinion for analyzing and understanding your generated SQL queries. I forked the original [query_reviewer](https://github.com/dsboulder/query_reviewer) and applied a collection of patches that have been made since the plugin was created. A list of the biggest additions below:
14
+ I use this utility for most of my MySQL-backed Rails projects. Still the best out there in my opinion for analyzing and understanding your generated SQL queries.
15
+ I forked the original [query_reviewer](https://github.com/dsboulder/query_reviewer) and applied a collection of patches that have been made since the plugin was created.
16
+ A list of the biggest additions below:
15
17
 
16
18
  * Snazzed up the README into markdown for better readability
17
19
  * Full compatibility for Rails 3 (including Railtie)
@@ -22,9 +24,21 @@ I use this utility for most of my rails projects. Still the best out there in my
22
24
  * Fixes for deprecation warnings and for 1.9 compatiblity
23
25
  * Converts templates to more modern foo.html.erb naming
24
26
 
25
- Last commit to the main repository was on March 30th, 2009. This fork compiles a variety of patches that were made since that time along with additional work to support compatibility with 1.9 and Rails 3. **Also:** If anyone else creates generally useful enhancements to this utility please start by forking this and then issue me a pull request.
27
+ As of August 2011, This has become the "official" version to use. David has deprecated the [original repo](https://github.com/dsboulder/query_reviewer) and recommends that people looking for this utility use this fork instead.
28
+ This fork compiles a variety of patches that were made since that time along with additional work to support compatibility with 1.9 and Rails 3.
29
+ **Also:** If anyone else creates generally useful enhancements to this utility please start by forking this and then issue me a pull request.
26
30
 
27
- **Note:** This plugin should work for Rails 2.X and Rails 3. Support for Rails 3 has been confirmed in the latest revision (with fixed deprecation warnings).
31
+ **Note:** This plugin should work for Rails 2.X and Rails 3. If you run into issues, please file a bug report or send a pull request. I consider this new fork to be a group effort
32
+ so if you want to be added as a contributor to help maintain this, please let me know!
33
+
34
+ ## Database Limitations ##
35
+
36
+ As of right now, this plugin supports analyzing queries **only for MySQL**. I consider this the primary **limitation** of this gem.
37
+ I am now using PostgreSQL for a number of my projects and the "EXPLAIN" output is totally different. Several people have started a PostgreSQL adapter for
38
+ this plugin, but none that are mature enough to include here.
39
+
40
+ If anyone is interested at taking a stab at implementing PostgreSQL support for this utility, that would be hugely appreciated! I hope this plugin can come to support
41
+ all the major Rails adapters over time.
28
42
 
29
43
  ## Installation ##
30
44
 
@@ -66,8 +80,8 @@ The configuration file allows you to set configuration parameters shared across
66
80
  * `profiling`: when enabled, runs the MySQL SET PROFILING=1 for queries longer than the `warn_duration_threshold` / 2.0
67
81
  * `production_data`: whether the duration of a query should be taken into account
68
82
  * `stack_trace_lines`: number of lines of call stack to include in the "short" version of the stack trace
69
- * `trace_includes_vendor`: whether the "short" verison of the stack trace should include files in /vendor
70
- * `trace_includes_lib`: whether the "short" verison of the stack trace should include files in /lib
83
+ * `trace_includes_vendor`: whether the "short" version of the stack trace should include files in /vendor
84
+ * `trace_includes_lib`: whether the "short" version of the stack trace should include files in /lib
71
85
  * `warn_severity`: the severity of problem that merits "WARNING" status
72
86
  * `critical_severity`: the severity of problem that merits "CRITICAL" status
73
87
  * `warn_query_count`: the number of queries in a single request that merits "WARNING" status
@@ -22,7 +22,12 @@ module QueryReviewer
22
22
 
23
23
  if enabled?
24
24
  begin
25
- CONFIGURATION["uv"] ||= !Gem.searcher.find("uv").nil?
25
+ CONFIGURATION["uv"] ||= if Gem::Specification.respond_to?(:find_all_by_name)
26
+ !Gem::Specification.find_all_by_name('uv').empty?
27
+ else # RubyGems < 1.8.0
28
+ !Gem.searcher.find("uv").nil?
29
+ end
30
+
26
31
  if CONFIGURATION["uv"]
27
32
  require "uv"
28
33
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: query_reviewer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
5
- prerelease: false
4
+ hash: 29
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - dsboulder, nesquena
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-07 00:00:00 -08:00
18
+ date: 2011-09-01 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  requirements: []
90
90
 
91
91
  rubyforge_project:
92
- rubygems_version: 1.3.7
92
+ rubygems_version: 1.6.2
93
93
  signing_key:
94
94
  specification_version: 3
95
95
  summary: Runs explain before each select query and displays results in an overlayed div