index_shotgun 0.1.0 → 0.2.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 +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.md +22 -0
- data/Gemfile +17 -0
- data/README.md +97 -2
- data/index_shotgun.gemspec +0 -3
- data/lib/index_shotgun/cli.rb +13 -0
- data/lib/index_shotgun/version.rb +1 -1
- metadata +2 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15bee0b6900c45e35a398f520eb0c83939c17bfe
|
4
|
+
data.tar.gz: b85e938abf213f4c914a256aac404bfbc37ba3e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ee1c4417f1800d03c6dac57605bb9d5e4e3b6cd685a6e51ee1eff8e0e403dd57bed092ab31f4dccf77c137f33aedb882c7dd76ea52d923e08fbaf42c409e641
|
7
|
+
data.tar.gz: b1839ef7c6311960a3e6dbf1d2fd6e547a7ce86ce90449ac57e936a0cb6a383e155153961d95b85256da845c59e76d9a18b31c2ce482cde37e72abc30ec0f61b
|
data/.travis.yml
CHANGED
@@ -11,6 +11,7 @@ before_script:
|
|
11
11
|
- export CI=true
|
12
12
|
- export CODECLIMATE_REPO_TOKEN=377596024a4c6f3c4c4b9a0cd16add92fb5e7f716663629b5efd080377c0b838
|
13
13
|
before_install: gem install bundler -v 1.10.6
|
14
|
+
bundler_args: --without oracle
|
14
15
|
script: "./travis_ci/build.sh"
|
15
16
|
branches:
|
16
17
|
only:
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,27 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [v0.1.0](https://github.com/sue445/index_shotgun/tree/v0.1.0) (2015/09/30)
|
4
|
+
[Full Changelog](https://github.com/sue445/index_shotgun/compare/v0.1.0.beta3...v0.1.0)
|
5
|
+
|
6
|
+
**Closed issues:**
|
7
|
+
|
8
|
+
- Write doc [\#9](https://github.com/sue445/index_shotgun/issues/9)
|
9
|
+
- 1st release features [\#4](https://github.com/sue445/index_shotgun/issues/4)
|
10
|
+
|
11
|
+
**Merged pull requests:**
|
12
|
+
|
13
|
+
- Add ask\_password [\#14](https://github.com/sue445/index_shotgun/pull/14) ([sue445](https://github.com/sue445))
|
14
|
+
- Add option alias [\#13](https://github.com/sue445/index_shotgun/pull/13) ([sue445](https://github.com/sue445))
|
15
|
+
- Tweak result message of unique index [\#12](https://github.com/sue445/index_shotgun/pull/12) ([sue445](https://github.com/sue445))
|
16
|
+
- Write doc [\#10](https://github.com/sue445/index_shotgun/pull/10) ([sue445](https://github.com/sue445))
|
17
|
+
|
18
|
+
## [v0.1.0.beta3](https://github.com/sue445/index_shotgun/tree/v0.1.0.beta3) (2015/09/17)
|
19
|
+
[Full Changelog](https://github.com/sue445/index_shotgun/compare/v0.1.0.beta2...v0.1.0.beta3)
|
20
|
+
|
21
|
+
**Merged pull requests:**
|
22
|
+
|
23
|
+
- Add summary [\#11](https://github.com/sue445/index_shotgun/pull/11) ([sue445](https://github.com/sue445))
|
24
|
+
|
3
25
|
## [v0.1.0.beta2](https://github.com/sue445/index_shotgun/tree/v0.1.0.beta2) (2015/09/16)
|
4
26
|
[Full Changelog](https://github.com/sue445/index_shotgun/compare/v0.1.0.beta1...v0.1.0.beta2)
|
5
27
|
|
data/Gemfile
CHANGED
@@ -2,3 +2,20 @@ source "https://rubygems.org"
|
|
2
2
|
|
3
3
|
# Specify your gem's dependencies in index_shotgun.gemspec
|
4
4
|
gemspec
|
5
|
+
|
6
|
+
group :mysql do
|
7
|
+
gem "mysql2", "< 0.4.0"
|
8
|
+
end
|
9
|
+
|
10
|
+
group :oracle do
|
11
|
+
gem "activerecord-oracle_enhanced-adapter"
|
12
|
+
gem "ruby-oci8"
|
13
|
+
end
|
14
|
+
|
15
|
+
group :postgresql do
|
16
|
+
gem "pg"
|
17
|
+
end
|
18
|
+
|
19
|
+
group :sqlite3 do
|
20
|
+
gem "sqlite3"
|
21
|
+
end
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
[](https://coveralls.io/github/sue445/index_shotgun?branch=master)
|
6
6
|
[](https://gemnasium.com/sue445/index_shotgun)
|
7
7
|
|
8
|
-
Duplicate index checker.
|
8
|
+
Duplicate index checker.
|
9
9
|
|
10
10
|
This like [pt-duplicate-key-checker](https://www.percona.com/doc/percona-toolkit/2.1/pt-duplicate-key-checker.html), but also supports database other than MySQL
|
11
11
|
|
@@ -62,7 +62,17 @@ end
|
|
62
62
|
And then execute:
|
63
63
|
|
64
64
|
```sh
|
65
|
-
|
65
|
+
# MySQL
|
66
|
+
$ bundle install --without oracle postgresql sqlite3
|
67
|
+
|
68
|
+
# Oracle
|
69
|
+
$ bundle install --without mysql postgresql sqlite3
|
70
|
+
|
71
|
+
# PostgreSQL
|
72
|
+
$ bundle install --without mysql oracle sqlite3
|
73
|
+
|
74
|
+
# sqlite3
|
75
|
+
$ bundle install --without mysql oracle postgresql
|
66
76
|
```
|
67
77
|
|
68
78
|
Or install it yourself as:
|
@@ -77,6 +87,9 @@ If you want to use as commandline tool, you need to install these gems.
|
|
77
87
|
# MySQL
|
78
88
|
$ gem install mysql2 -v 0.3.20
|
79
89
|
|
90
|
+
# Oracle
|
91
|
+
$ gem install activerecord-oracle_enhanced-adapter ruby-oci8
|
92
|
+
|
80
93
|
# PostgreSQL
|
81
94
|
$ gem install pg
|
82
95
|
|
@@ -109,6 +122,7 @@ $ index_shotgun
|
|
109
122
|
Commands:
|
110
123
|
index_shotgun help [COMMAND] # Describe available commands or one specific command
|
111
124
|
index_shotgun mysql --database=DATABASE # Search duplicate indexes on MySQL
|
125
|
+
index_shotgun oracle --database=DATABASE # Search duplicate indexes on Oracle
|
112
126
|
index_shotgun postgresql --database=DATABASE # Search duplicate indexes on PostgreSQL
|
113
127
|
index_shotgun sqlite3 --database=DATABASE # Search duplicate indexes on sqlite3
|
114
128
|
index_shotgun version # Show index_shotgun version
|
@@ -116,6 +130,87 @@ Commands:
|
|
116
130
|
|
117
131
|
**Details:** check `index_shotgun help <database>`
|
118
132
|
|
133
|
+
#### MySQL
|
134
|
+
```sh
|
135
|
+
$ index_shotgun help mysql
|
136
|
+
Usage:
|
137
|
+
index_shotgun mysql d, --database=DATABASE
|
138
|
+
|
139
|
+
Options:
|
140
|
+
d, --database=DATABASE
|
141
|
+
[--encoding=ENCODING]
|
142
|
+
# Default: utf8
|
143
|
+
[--pool=N]
|
144
|
+
# Default: 5
|
145
|
+
h, [--host=HOST]
|
146
|
+
# Default: localhost
|
147
|
+
P, [--port=N]
|
148
|
+
# Default: 3306
|
149
|
+
u, [--username=USERNAME]
|
150
|
+
p, [--password=PASSWORD]
|
151
|
+
[--ask-password], [--no-ask-password]
|
152
|
+
|
153
|
+
Search duplicate indexes on MySQL
|
154
|
+
```
|
155
|
+
|
156
|
+
#### Oracle
|
157
|
+
```sh
|
158
|
+
$ index_shotgun help oracle
|
159
|
+
Usage:
|
160
|
+
index_shotgun oracle d, --database=DATABASE
|
161
|
+
|
162
|
+
Options:
|
163
|
+
d, --database=DATABASE
|
164
|
+
[--encoding=ENCODING]
|
165
|
+
# Default: utf8
|
166
|
+
[--pool=N]
|
167
|
+
# Default: 5
|
168
|
+
h, [--host=HOST]
|
169
|
+
# Default: localhost
|
170
|
+
P, [--port=N]
|
171
|
+
# Default: 1521
|
172
|
+
u, [--username=USERNAME]
|
173
|
+
p, [--password=PASSWORD]
|
174
|
+
[--ask-password], [--no-ask-password]
|
175
|
+
|
176
|
+
Search duplicate indexes on Oracle
|
177
|
+
```
|
178
|
+
|
179
|
+
#### PostgreSQL
|
180
|
+
```sh
|
181
|
+
$ index_shotgun help postgresql
|
182
|
+
Usage:
|
183
|
+
index_shotgun postgresql d, --database=DATABASE
|
184
|
+
|
185
|
+
Options:
|
186
|
+
d, --database=DATABASE
|
187
|
+
[--encoding=ENCODING]
|
188
|
+
# Default: utf8
|
189
|
+
[--pool=N]
|
190
|
+
# Default: 5
|
191
|
+
h, [--host=HOST]
|
192
|
+
# Default: localhost
|
193
|
+
P, [--port=N]
|
194
|
+
# Default: 5432
|
195
|
+
u, [--username=USERNAME]
|
196
|
+
p, [--password=PASSWORD]
|
197
|
+
[--ask-password], [--no-ask-password]
|
198
|
+
|
199
|
+
Search duplicate indexes on PostgreSQL
|
200
|
+
```
|
201
|
+
|
202
|
+
#### SQLite3
|
203
|
+
```sh
|
204
|
+
$ index_shotgun help sqlite3
|
205
|
+
Usage:
|
206
|
+
index_shotgun sqlite3 d, --database=DATABASE
|
207
|
+
|
208
|
+
Options:
|
209
|
+
d, --database=DATABASE
|
210
|
+
|
211
|
+
Search duplicate indexes on sqlite3
|
212
|
+
```
|
213
|
+
|
119
214
|
## Development
|
120
215
|
|
121
216
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. Run `bundle exec index_shotgun` to use the gem in this directory, ignoring other installed copies of this gem.
|
data/index_shotgun.gemspec
CHANGED
@@ -35,8 +35,6 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.add_development_dependency "bundler", "~> 1.10"
|
36
36
|
spec.add_development_dependency "codeclimate-test-reporter"
|
37
37
|
spec.add_development_dependency "coveralls"
|
38
|
-
spec.add_development_dependency "mysql2", "< 0.4.0"
|
39
|
-
spec.add_development_dependency "pg"
|
40
38
|
spec.add_development_dependency "pry-byebug"
|
41
39
|
spec.add_development_dependency "rake", "~> 10.0"
|
42
40
|
spec.add_development_dependency "rake_shared_context"
|
@@ -44,5 +42,4 @@ Gem::Specification.new do |spec|
|
|
44
42
|
spec.add_development_dependency "rspec-its"
|
45
43
|
spec.add_development_dependency "rspec-power_assert"
|
46
44
|
spec.add_development_dependency "rubocop", "0.31.0"
|
47
|
-
spec.add_development_dependency "sqlite3"
|
48
45
|
end
|
data/lib/index_shotgun/cli.rb
CHANGED
@@ -17,6 +17,19 @@ module IndexShotgun
|
|
17
17
|
analyze("mysql2")
|
18
18
|
end
|
19
19
|
|
20
|
+
desc "oracle", "Search duplicate indexes on Oracle"
|
21
|
+
option :database, aliases: "d", required: true
|
22
|
+
option :encoding, default: "utf8"
|
23
|
+
option :pool, default: 5, type: :numeric
|
24
|
+
option :host, aliases: "h", default: "localhost"
|
25
|
+
option :port, aliases: "P", default: 1521, type: :numeric
|
26
|
+
option :username, aliases: "u"
|
27
|
+
option :password, aliases: "p"
|
28
|
+
option :ask_password, default: false, type: :boolean
|
29
|
+
def oracle
|
30
|
+
analyze("oracle_enhanced", "activerecord-oracle_enhanced-adapter")
|
31
|
+
end
|
32
|
+
|
20
33
|
desc "postgresql", "Search duplicate indexes on PostgreSQL"
|
21
34
|
option :database, aliases: "d", required: true
|
22
35
|
option :encoding, default: "utf8"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: index_shotgun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sue445
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09
|
11
|
+
date: 2015-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -80,34 +80,6 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: mysql2
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "<"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: 0.4.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.4.0
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: pg
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
83
|
- !ruby/object:Gem::Dependency
|
112
84
|
name: pry-byebug
|
113
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -206,20 +178,6 @@ dependencies:
|
|
206
178
|
- - '='
|
207
179
|
- !ruby/object:Gem::Version
|
208
180
|
version: 0.31.0
|
209
|
-
- !ruby/object:Gem::Dependency
|
210
|
-
name: sqlite3
|
211
|
-
requirement: !ruby/object:Gem::Requirement
|
212
|
-
requirements:
|
213
|
-
- - ">="
|
214
|
-
- !ruby/object:Gem::Version
|
215
|
-
version: '0'
|
216
|
-
type: :development
|
217
|
-
prerelease: false
|
218
|
-
version_requirements: !ruby/object:Gem::Requirement
|
219
|
-
requirements:
|
220
|
-
- - ">="
|
221
|
-
- !ruby/object:Gem::Version
|
222
|
-
version: '0'
|
223
181
|
description: duplicate index checker
|
224
182
|
email:
|
225
183
|
- sue445@sue445.net
|