wt_activerecord_index_spy 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 139af66e444d627962e5c1012c22bb950aaf2e4f5ca4626068174beb75664bb6
|
4
|
+
data.tar.gz: 5f0d2385cf19cee78366660c2d647dbe468a86f189589a4c745c91df18d84bf9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f211a9e65df94123ce1404e35a13c615eafe0a9fe5189ccf0397d64fc357dba80e099e7f08c6c4f28c738e1dc10fa52f41bfab3e3f0579cf751768684ea37fb
|
7
|
+
data.tar.gz: f753b9c6c7362464de58317d0bfcadd9fdf1ce587468568a07524fe9fecbb371460c1604b2a800563ae2bbacd705ffa1c1542519361f6aae4278151289df6998
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 0.4.0
|
2
|
+
* change `NotificationListener` to ignore queries to INFORMATION_SCHEMA
|
3
|
+
* change `NotificationListener` to not ignore queries with an empty identifier, for example, when running with `ActiveRecord::Base.connection.execute`
|
4
|
+
|
1
5
|
## 0.3.0
|
2
6
|
* add support for PostgreSQL (unfortunately all results are uncertain)
|
3
7
|
* add support for Ruby >= 2.5 and Activerecord >= 4
|
data/Gemfile
CHANGED
@@ -11,7 +11,7 @@ gem "rspec", "~> 3.0"
|
|
11
11
|
|
12
12
|
gem "rubocop", "~> 1.7"
|
13
13
|
|
14
|
-
active_record_version = ENV.fetch("ACTIVE_RECORD_VERSION", "~>
|
14
|
+
active_record_version = ENV.fetch("ACTIVE_RECORD_VERSION", "~> 6")
|
15
15
|
|
16
16
|
gem "activerecord", active_record_version
|
17
17
|
gem "activesupport", active_record_version
|
@@ -21,7 +21,8 @@ module WtActiverecordIndexSpy
|
|
21
21
|
/^SELECT @@FOREIGN_KEY_CHECKS/,
|
22
22
|
/^SET FOREIGN_KEY_CHECKS/,
|
23
23
|
/^TRUNCATE TABLE/,
|
24
|
-
/^EXPLAIN
|
24
|
+
/^EXPLAIN/,
|
25
|
+
/FROM INFORMATION_SCHEMA/,
|
25
26
|
].freeze
|
26
27
|
|
27
28
|
attr_reader :queries_missing_index
|
@@ -44,7 +45,7 @@ module WtActiverecordIndexSpy
|
|
44
45
|
identifier = values[:name]
|
45
46
|
|
46
47
|
if ignore_query?(query: query, name: identifier)
|
47
|
-
logger.debug "query type ignored"
|
48
|
+
logger.debug "query type ignored, name: #{identifier}, query: #{query}"
|
48
49
|
return
|
49
50
|
end
|
50
51
|
logger.debug "query type accepted"
|
@@ -88,7 +89,6 @@ module WtActiverecordIndexSpy
|
|
88
89
|
# the query was cached
|
89
90
|
name == "CACHE" ||
|
90
91
|
name == "SCHEMA" ||
|
91
|
-
!name ||
|
92
92
|
!query.downcase.include?("where") ||
|
93
93
|
IGNORED_SQL.any? { |r| query =~ r }
|
94
94
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wt_activerecord_index_spy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fabio Perrella
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -165,7 +165,7 @@ metadata:
|
|
165
165
|
homepage_uri: https://github.com/fabioperrella/wt_activerecord_index_spy
|
166
166
|
source_code_uri: https://github.com/fabioperrella/wt_activerecord_index_spy
|
167
167
|
changelog_uri: https://github.com/fabioperrella/wt_activerecord_index_spy/blob/main/CHANGELOG.md
|
168
|
-
post_install_message:
|
168
|
+
post_install_message:
|
169
169
|
rdoc_options: []
|
170
170
|
require_paths:
|
171
171
|
- lib
|
@@ -180,8 +180,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
180
|
- !ruby/object:Gem::Version
|
181
181
|
version: '0'
|
182
182
|
requirements: []
|
183
|
-
rubygems_version: 3.
|
184
|
-
signing_key:
|
183
|
+
rubygems_version: 3.1.6
|
184
|
+
signing_key:
|
185
185
|
specification_version: 4
|
186
186
|
summary: It checks if queries use an index
|
187
187
|
test_files: []
|