activerecord-analyze 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -7
- data/lib/activerecord-analyze/main.rb +0 -7
- data/lib/activerecord-analyze/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2021239ed9352a040106ce8c1de50503e785fccd9a3093928eeaf5dfa79a0dc
|
4
|
+
data.tar.gz: 8ba00244e759dc1f31091ec4196aded3887c9007902faf867431ea2ef9ae93dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad2874f8422dc7299b8b7b3036fbec8e90f29780862ea3dd192629894905aafede52731314cc569afb6c9ce31f61a379b31ac308af0c304fc9e72bea583e58a7
|
7
|
+
data.tar.gz: 114236b8af394e3f7fad06549e3bc99fa1814e815dd93282c7d3abfc0a0535ee568d90c0360abab021c83a7f1b38d2bfd0bfec31f043720893ab321776fe83fe
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# ActiveRecord Analyze [![Gem Version](https://badge.fury.io/rb/activerecord-analyze.svg)](https://badge.fury.io/rb/
|
1
|
+
# ActiveRecord Analyze [![Gem Version](https://badge.fury.io/rb/activerecord-analyze.svg)](https://badge.fury.io/rb/activerecord-analyze) [![CircleCI](https://circleci.com/gh/pawurb/activerecord-analyze.svg?style=svg)](https://circleci.com/gh/pawurb/activerecord-analyze)
|
2
2
|
|
3
3
|
This gem adds an `analyze` method to Active Record query objects. It executes `EXPLAIN ANALYZE` on a query SQL.
|
4
4
|
|
@@ -23,12 +23,12 @@ gem 'activerecord-analyze'
|
|
23
23
|
The `analyze` method supports the following EXPLAIN query options ([PostgreSQL docs reference](https://www.postgresql.org/docs/12/sql-explain.html)):
|
24
24
|
|
25
25
|
```
|
26
|
-
BUFFERS [ boolean ]
|
27
|
-
VERBOSE [ boolean ]
|
28
|
-
COSTS [ boolean ]
|
29
|
-
SETTINGS [ boolean ]
|
30
|
-
TIMING [ boolean ]
|
31
|
-
SUMMARY [ boolean ]
|
26
|
+
BUFFERS [ boolean ]
|
27
|
+
VERBOSE [ boolean ]
|
28
|
+
COSTS [ boolean ]
|
29
|
+
SETTINGS [ boolean ]
|
30
|
+
TIMING [ boolean ]
|
31
|
+
SUMMARY [ boolean ]
|
32
32
|
FORMAT { TEXT | XML | JSON | YAML }
|
33
33
|
```
|
34
34
|
|
@@ -3,13 +3,6 @@ module ActiveRecord
|
|
3
3
|
module PostgreSQL
|
4
4
|
module DatabaseStatements
|
5
5
|
def analyze(arel, binds = [], opts = {})
|
6
|
-
default_opts = {
|
7
|
-
buffers: true,
|
8
|
-
verbose: true
|
9
|
-
}
|
10
|
-
|
11
|
-
opts = default_opts.merge(opts)
|
12
|
-
|
13
6
|
format_sql = if fmt = opts[:format].presence
|
14
7
|
case fmt
|
15
8
|
when :json
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-analyze
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pawurb
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|