mysql_casual_explain 1.1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +14 -0
- data/.github/workflows/test.yml +18 -20
- data/.rubocop.yml +2 -1
- data/Appraisals +14 -6
- data/Dockerfile +2 -8
- data/Gemfile +5 -1
- data/README.md +2 -1
- data/docker-compose.yml +1 -2
- data/gemfiles/ar61.gemfile +5 -1
- data/gemfiles/ar70.gemfile +13 -0
- data/gemfiles/ar71.gemfile +13 -0
- data/gemfiles/ar72.gemfile +13 -0
- data/gemfiles/ar80.gemfile +13 -0
- data/lib/mysql_casual_explain/pretty_printer.rb +3 -7
- data/lib/mysql_casual_explain/version.rb +1 -1
- data/mysql_casual_explain.gemspec +3 -10
- metadata +13 -119
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be1a3fb35a806ac0b6f0cad418e3c3515288df182f7f9d706e856b59a1676dff
|
4
|
+
data.tar.gz: 68f9271656819c729762d6c0928db48de75af1934c5169826b29f0b48f36510d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90a8724846c019e87a81654a13e792fc02fb72a872c735caa0379dc5a2dde2124054d774a56c08b2bc2be5c52be51b3577e7e9559e2cff962985f040057eccba
|
7
|
+
data.tar.gz: f5494a4999318586c9e7409384cfe8158efa5a019b481d2d5748269258d7c583e0c3eec1a8c9bb698bc6982d5e6f8f14134c999d1428c37cf846ecdb8f2bb4cf
|
data/.github/workflows/test.yml
CHANGED
@@ -2,14 +2,20 @@ name: test
|
|
2
2
|
|
3
3
|
on:
|
4
4
|
push:
|
5
|
+
branches:
|
6
|
+
- master
|
5
7
|
pull_request:
|
6
8
|
|
9
|
+
concurrency:
|
10
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
11
|
+
cancel-in-progress: true
|
12
|
+
|
7
13
|
jobs:
|
8
14
|
build:
|
9
15
|
runs-on: ubuntu-latest
|
10
16
|
services:
|
11
17
|
mysql:
|
12
|
-
image: budougumi0617/mysql-sakila:
|
18
|
+
image: budougumi0617/mysql-sakila:8.0
|
13
19
|
ports:
|
14
20
|
- 3306:3306
|
15
21
|
env:
|
@@ -19,34 +25,26 @@ jobs:
|
|
19
25
|
fail-fast: false
|
20
26
|
matrix:
|
21
27
|
ruby:
|
22
|
-
-
|
23
|
-
- 2
|
24
|
-
-
|
25
|
-
- 3.0
|
28
|
+
- 3.1
|
29
|
+
- 3.2
|
30
|
+
- 3.3
|
26
31
|
gemfile:
|
27
|
-
- gemfiles/ar52.gemfile
|
28
|
-
- gemfiles/ar60.gemfile
|
29
32
|
- gemfiles/ar61.gemfile
|
33
|
+
- gemfiles/ar70.gemfile
|
34
|
+
- gemfiles/ar71.gemfile
|
35
|
+
- gemfiles/ar72.gemfile
|
36
|
+
- gemfiles/ar80.gemfile
|
30
37
|
exclude:
|
31
|
-
- ruby: 3.
|
32
|
-
gemfile: gemfiles/
|
38
|
+
- ruby: 3.1
|
39
|
+
gemfile: gemfiles/ar80.gemfile
|
33
40
|
env:
|
34
41
|
DATABASE_URL: mysql2://root@127.0.0.1/sakila
|
35
42
|
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
36
43
|
steps:
|
37
|
-
- uses: actions/checkout@
|
44
|
+
- uses: actions/checkout@v4
|
38
45
|
- uses: ruby/setup-ruby@v1
|
39
46
|
with:
|
40
47
|
ruby-version: ${{ matrix.ruby }}
|
41
|
-
|
42
|
-
with:
|
43
|
-
path: gemfiles/vendor/bundle
|
44
|
-
key: ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ matrix.gemfile }}
|
45
|
-
restore-keys: |
|
46
|
-
${{ runner.os }}-gems-${{ matrix.ruby }}-${{ matrix.gemfile }}
|
47
|
-
- name: Setup dependencies
|
48
|
-
run: |
|
49
|
-
bundle config path vendor/bundle
|
50
|
-
bundle install --jobs 4 --retry 3
|
48
|
+
bundler-cache: true
|
51
49
|
- name: Run tests
|
52
50
|
run: bundle exec rake
|
data/.rubocop.yml
CHANGED
data/Appraisals
CHANGED
@@ -1,13 +1,21 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
appraise '
|
4
|
-
gem 'activerecord', '~>
|
3
|
+
appraise 'ar61' do
|
4
|
+
gem 'activerecord', '~> 6.1'
|
5
5
|
end
|
6
6
|
|
7
|
-
appraise '
|
8
|
-
gem 'activerecord', '~>
|
7
|
+
appraise 'ar70' do
|
8
|
+
gem 'activerecord', '~> 7.0'
|
9
9
|
end
|
10
10
|
|
11
|
-
appraise '
|
12
|
-
gem 'activerecord', '~>
|
11
|
+
appraise 'ar71' do
|
12
|
+
gem 'activerecord', '~> 7.1'
|
13
|
+
end
|
14
|
+
|
15
|
+
appraise 'ar72' do
|
16
|
+
gem 'activerecord', '~> 7.2'
|
17
|
+
end
|
18
|
+
|
19
|
+
appraise 'ar80' do
|
20
|
+
gem 'activerecord', '~> 8.0'
|
13
21
|
end
|
data/Dockerfile
CHANGED
@@ -1,14 +1,8 @@
|
|
1
|
-
FROM
|
2
|
-
|
3
|
-
RUN apt-get update && \
|
4
|
-
apt-get install -y \
|
5
|
-
mysql-client \
|
6
|
-
libmysqlclient-dev \
|
7
|
-
rubygems \
|
8
|
-
curl
|
1
|
+
FROM ruby:3.3
|
9
2
|
|
10
3
|
COPY ./ /mnt/
|
11
4
|
WORKDIR /mnt
|
5
|
+
RUN git config --global --add safe.directory /mnt
|
12
6
|
RUN gem update bundler -f && \
|
13
7
|
bundle install && \
|
14
8
|
bundle exec appraisal install
|
data/Gemfile
CHANGED
@@ -5,5 +5,9 @@ source 'https://rubygems.org'
|
|
5
5
|
# Specify your gem's dependencies in mysql_casual_explain.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
|
-
gem '
|
8
|
+
gem 'appraisal'
|
9
|
+
gem 'mysql2'
|
9
10
|
gem 'rspec', '~> 3.0'
|
11
|
+
gem 'rubocop', '>= 1.68'
|
12
|
+
gem 'rubocop-rake'
|
13
|
+
gem 'rubocop-rspec'
|
data/README.md
CHANGED
@@ -4,7 +4,8 @@ Highlight problematic MySQL explain results.
|
|
4
4
|
|
5
5
|
Inspired by [MySQLCasualLog.pm](https://gist.github.com/kamipo/839e8a5b6d12bddba539).
|
6
6
|
|
7
|
-
[![
|
7
|
+
[![Gem Version](https://badge.fury.io/rb/mysql_casual_explain.svg)](https://badge.fury.io/rb/mysql_casual_explain)
|
8
|
+
[![test](https://github.com/winebarrel/mysql_casual_explain/actions/workflows/test.yml/badge.svg)](https://github.com/winebarrel/mysql_casual_explain/actions/workflows/test.yml)
|
8
9
|
|
9
10
|
## Installation
|
10
11
|
|
data/docker-compose.yml
CHANGED
data/gemfiles/ar61.gemfile
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "appraisal"
|
6
|
+
gem "mysql2"
|
7
|
+
gem "rspec", "~> 3.0"
|
8
|
+
gem "rubocop", ">= 1.68"
|
9
|
+
gem "rubocop-rake"
|
10
|
+
gem "rubocop-rspec"
|
11
|
+
gem "activerecord", "~> 7.0"
|
12
|
+
|
13
|
+
gemspec path: "../"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "appraisal"
|
6
|
+
gem "mysql2"
|
7
|
+
gem "rspec", "~> 3.0"
|
8
|
+
gem "rubocop", ">= 1.68"
|
9
|
+
gem "rubocop-rake"
|
10
|
+
gem "rubocop-rspec"
|
11
|
+
gem "activerecord", "~> 7.1"
|
12
|
+
|
13
|
+
gemspec path: "../"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "appraisal"
|
6
|
+
gem "mysql2"
|
7
|
+
gem "rspec", "~> 3.0"
|
8
|
+
gem "rubocop", ">= 1.68"
|
9
|
+
gem "rubocop-rake"
|
10
|
+
gem "rubocop-rspec"
|
11
|
+
gem "activerecord", "~> 7.2"
|
12
|
+
|
13
|
+
gemspec path: "../"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "appraisal"
|
6
|
+
gem "mysql2"
|
7
|
+
gem "rspec", "~> 3.0"
|
8
|
+
gem "rubocop", ">= 1.68"
|
9
|
+
gem "rubocop-rake"
|
10
|
+
gem "rubocop-rspec"
|
11
|
+
gem "activerecord", "~> 8.0"
|
12
|
+
|
13
|
+
gemspec path: "../"
|
@@ -2,10 +2,6 @@
|
|
2
2
|
|
3
3
|
module MysqlCasualExplain
|
4
4
|
module PrettyPrinter
|
5
|
-
BOLD = ActiveSupport::LogSubscriber::BOLD
|
6
|
-
RED = ActiveSupport::LogSubscriber::RED
|
7
|
-
CLEAR = ActiveSupport::LogSubscriber::CLEAR
|
8
|
-
|
9
5
|
def pp(result, elapsed)
|
10
6
|
widths = compute_column_widths(result)
|
11
7
|
separator = build_separator(widths)
|
@@ -40,15 +36,15 @@ module MysqlCasualExplain
|
|
40
36
|
|
41
37
|
new_items = []
|
42
38
|
new_widths = []
|
43
|
-
extra_len =
|
39
|
+
extra_len = ActiveSupport::LogSubscriber.new.send(:color, '', :red, bold: true).length
|
44
40
|
|
45
41
|
item_by_column.each_with_index do |(column, item), i|
|
46
42
|
item = 'NULL' if item.nil?
|
47
43
|
warnings = warnings_by_column.fetch(column, [])
|
48
44
|
|
49
45
|
if warnings.any? { |w| w.call(item) }
|
50
|
-
new_items <<
|
51
|
-
new_widths << widths[i] + extra_len
|
46
|
+
new_items << ActiveSupport::LogSubscriber.new.send(:color, item, :red, bold: true)
|
47
|
+
new_widths << (widths[i] + extra_len)
|
52
48
|
else
|
53
49
|
new_items << item
|
54
50
|
new_widths << widths[i]
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.description = 'Highlight problematic MySQL explain results.'
|
13
13
|
spec.homepage = 'https://github.com/winebarrel/mysql_casual_explain'
|
14
14
|
spec.license = 'MIT'
|
15
|
-
spec.required_ruby_version = Gem::Requirement.new('>=
|
15
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 3.1.0')
|
16
16
|
|
17
17
|
# Specify which files should be added to the gem when it is released.
|
18
18
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -23,13 +23,6 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
24
|
spec.require_paths = ['lib']
|
25
25
|
|
26
|
-
spec.add_dependency 'activerecord', '>=
|
27
|
-
spec.
|
28
|
-
spec.add_development_dependency 'bundler'
|
29
|
-
spec.add_development_dependency 'mysql2'
|
30
|
-
spec.add_development_dependency 'rake'
|
31
|
-
spec.add_development_dependency 'rspec'
|
32
|
-
spec.add_development_dependency 'rubocop', '>= 1.8.1'
|
33
|
-
spec.add_development_dependency 'rubocop-rake'
|
34
|
-
spec.add_development_dependency 'rubocop-rspec'
|
26
|
+
spec.add_dependency 'activerecord', '>= 6.1'
|
27
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
35
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mysql_casual_explain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- winebarrel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -16,126 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '6.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: appraisal
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: bundler
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: mysql2
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rake
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: rspec
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: rubocop
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: 1.8.1
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: 1.8.1
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: rubocop-rake
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ">="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ">="
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: rubocop-rspec
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - ">="
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '0'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - ">="
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '0'
|
26
|
+
version: '6.1'
|
139
27
|
description: Highlight problematic MySQL explain results.
|
140
28
|
email:
|
141
29
|
- sugawara@winebarrel.jp
|
@@ -143,6 +31,7 @@ executables: []
|
|
143
31
|
extensions: []
|
144
32
|
extra_rdoc_files: []
|
145
33
|
files:
|
34
|
+
- ".github/dependabot.yml"
|
146
35
|
- ".github/workflows/test.yml"
|
147
36
|
- ".gitignore"
|
148
37
|
- ".rspec"
|
@@ -158,6 +47,10 @@ files:
|
|
158
47
|
- gemfiles/ar52.gemfile
|
159
48
|
- gemfiles/ar60.gemfile
|
160
49
|
- gemfiles/ar61.gemfile
|
50
|
+
- gemfiles/ar70.gemfile
|
51
|
+
- gemfiles/ar71.gemfile
|
52
|
+
- gemfiles/ar72.gemfile
|
53
|
+
- gemfiles/ar80.gemfile
|
161
54
|
- lib/mysql_casual_explain.rb
|
162
55
|
- lib/mysql_casual_explain/config.rb
|
163
56
|
- lib/mysql_casual_explain/pretty_printer.rb
|
@@ -166,7 +59,8 @@ files:
|
|
166
59
|
homepage: https://github.com/winebarrel/mysql_casual_explain
|
167
60
|
licenses:
|
168
61
|
- MIT
|
169
|
-
metadata:
|
62
|
+
metadata:
|
63
|
+
rubygems_mfa_required: 'true'
|
170
64
|
post_install_message:
|
171
65
|
rdoc_options: []
|
172
66
|
require_paths:
|
@@ -175,14 +69,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
175
69
|
requirements:
|
176
70
|
- - ">="
|
177
71
|
- !ruby/object:Gem::Version
|
178
|
-
version:
|
72
|
+
version: 3.1.0
|
179
73
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
180
74
|
requirements:
|
181
75
|
- - ">="
|
182
76
|
- !ruby/object:Gem::Version
|
183
77
|
version: '0'
|
184
78
|
requirements: []
|
185
|
-
rubygems_version: 3.
|
79
|
+
rubygems_version: 3.5.20
|
186
80
|
signing_key:
|
187
81
|
specification_version: 4
|
188
82
|
summary: Highlight problematic MySQL explain results.
|