spring_onion 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/spring_onion/explainer.rb +4 -4
- data/lib/spring_onion/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b40885dd3b876b902fa6670cde6f312362239a5d65da300297f9240cee05afbc
|
4
|
+
data.tar.gz: 3193d9ab4417169c380bb9fe1bf788752b4f347d9c0bdb34b5237a9f5e2c674f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1f37308e5b4dbc00112b4cc7e12a1060fe4c39a8dbb379bb5d10bf3c689151d590095a39e4f732c236993f19efccd8b624bd5baf7f162c3422646f49a377728
|
7
|
+
data.tar.gz: 73aafec72dad64c8e54daa129dd65bbd419f7dc013b94da830228825211a2e3693627185c5e9f50f02b4217f24a244feec7a324a14267c32f0e063c7149febb2
|
data/Gemfile.lock
CHANGED
@@ -3,14 +3,14 @@
|
|
3
3
|
module SpringOnion
|
4
4
|
module Explainer
|
5
5
|
def execute(*args)
|
6
|
-
_with_explain(args.first) do
|
6
|
+
_with_explain(sql: args.first) do
|
7
7
|
super
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
11
|
private
|
12
12
|
|
13
|
-
def _with_explain(sql)
|
13
|
+
def _with_explain(sql:)
|
14
14
|
begin
|
15
15
|
if SpringOnion.enabled && sql =~ /\A\s*SELECT\b/i && SpringOnion.sql_filter.call(sql)
|
16
16
|
trace = SpringOnion.source_filter.call(caller)
|
@@ -21,7 +21,7 @@ module SpringOnion
|
|
21
21
|
|
22
22
|
exp = conn.query("EXPLAIN #{sql}", as: :hash).to_a
|
23
23
|
exp.each { |r| r.delete('id') }
|
24
|
-
_validate_explain(
|
24
|
+
_validate_explain(sql: sql, exp: exp, trace: trace)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
rescue StandardError => e
|
@@ -31,7 +31,7 @@ module SpringOnion
|
|
31
31
|
yield
|
32
32
|
end
|
33
33
|
|
34
|
-
def _validate_explain(exp
|
34
|
+
def _validate_explain(sql:, exp:, trace:)
|
35
35
|
warnings = SpringOnion.warnings
|
36
36
|
warning_names_by_index = {}
|
37
37
|
|
data/lib/spring_onion/version.rb
CHANGED