active_record_mysql_repl 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +3 -0
- data/.standard.yml +3 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +132 -0
- data/LICENSE.txt +21 -0
- data/README.md +43 -0
- data/Rakefile +10 -0
- data/exe/army +5 -0
- data/json_schemas/army_schema.json +34 -0
- data/json_schemas/association_schema.json +80 -0
- data/json_schemas/databases_schema.json +61 -0
- data/lib/active_record_mysql_repl/cli/erd.rb +11 -0
- data/lib/active_record_mysql_repl/cli/main.rb +60 -0
- data/lib/active_record_mysql_repl/cli/options.rb +13 -0
- data/lib/active_record_mysql_repl/cli/zsh_completion.rb +37 -0
- data/lib/active_record_mysql_repl/cli.rb +10 -0
- data/lib/active_record_mysql_repl/config.rb +38 -0
- data/lib/active_record_mysql_repl/database/association/analysis.rb +17 -0
- data/lib/active_record_mysql_repl/database/association/definition.rb +0 -0
- data/lib/active_record_mysql_repl/database/association.rb +83 -0
- data/lib/active_record_mysql_repl/database/configs.rb +53 -0
- data/lib/active_record_mysql_repl/database/connection.rb +42 -0
- data/lib/active_record_mysql_repl/database/loader.rb +63 -0
- data/lib/active_record_mysql_repl/database.rb +10 -0
- data/lib/active_record_mysql_repl/extensions/active_record.rb +32 -0
- data/lib/active_record_mysql_repl/extensions/global.rb +29 -0
- data/lib/active_record_mysql_repl/extensions/hash.rb +20 -0
- data/lib/active_record_mysql_repl/extensions/object.rb +138 -0
- data/lib/active_record_mysql_repl/extensions/tabler.rb +32 -0
- data/lib/active_record_mysql_repl/extensions.rb +18 -0
- data/lib/active_record_mysql_repl/ssh_tunnel.rb +21 -0
- data/lib/active_record_mysql_repl/version.rb +5 -0
- data/lib/active_record_mysql_repl.rb +12 -0
- data/sample_config/.army.sample.yml +6 -0
- data/sample_config/.pryrc.sample +9 -0
- data/sample_config/associations.sample.yml +13 -0
- data/sample_config/databases.sample.yml +9 -0
- data/sample_config/sample_db.sql +153 -0
- metadata +75 -36
@@ -0,0 +1,153 @@
|
|
1
|
+
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
2
|
+
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
3
|
+
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
4
|
+
SET NAMES utf8mb4;
|
5
|
+
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
6
|
+
/*!40101 SET @OLD_SQL_MODE='NO_AUTO_VALUE_ON_ZERO', SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
7
|
+
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
8
|
+
|
9
|
+
|
10
|
+
# テーブルのダンプ brands
|
11
|
+
# ------------------------------------------------------------
|
12
|
+
|
13
|
+
DROP TABLE IF EXISTS `brands`;
|
14
|
+
|
15
|
+
CREATE TABLE `brands` (
|
16
|
+
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
|
17
|
+
`name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
|
18
|
+
PRIMARY KEY (`id`)
|
19
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
|
20
|
+
|
21
|
+
LOCK TABLES `brands` WRITE;
|
22
|
+
/*!40000 ALTER TABLE `brands` DISABLE KEYS */;
|
23
|
+
|
24
|
+
INSERT INTO `brands` (`id`, `name`)
|
25
|
+
VALUES
|
26
|
+
(X'31',X'6272616E6431');
|
27
|
+
|
28
|
+
/*!40000 ALTER TABLE `brands` ENABLE KEYS */;
|
29
|
+
UNLOCK TABLES;
|
30
|
+
|
31
|
+
|
32
|
+
# テーブルのダンプ categories
|
33
|
+
# ------------------------------------------------------------
|
34
|
+
|
35
|
+
DROP TABLE IF EXISTS `categories`;
|
36
|
+
|
37
|
+
CREATE TABLE `categories` (
|
38
|
+
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
|
39
|
+
`name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
|
40
|
+
`parent_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
|
41
|
+
PRIMARY KEY (`id`)
|
42
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
|
43
|
+
|
44
|
+
LOCK TABLES `categories` WRITE;
|
45
|
+
/*!40000 ALTER TABLE `categories` DISABLE KEYS */;
|
46
|
+
|
47
|
+
INSERT INTO `categories` (`id`, `name`, `parent_id`)
|
48
|
+
VALUES
|
49
|
+
(X'31',X'63617465676F727931',X''),
|
50
|
+
(X'32',X'63617465676F727932',X'31');
|
51
|
+
|
52
|
+
/*!40000 ALTER TABLE `categories` ENABLE KEYS */;
|
53
|
+
UNLOCK TABLES;
|
54
|
+
|
55
|
+
|
56
|
+
# テーブルのダンプ items
|
57
|
+
# ------------------------------------------------------------
|
58
|
+
|
59
|
+
DROP TABLE IF EXISTS `items`;
|
60
|
+
|
61
|
+
CREATE TABLE `items` (
|
62
|
+
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
|
63
|
+
`category_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
|
64
|
+
`brand_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
|
65
|
+
PRIMARY KEY (`id`)
|
66
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
|
67
|
+
|
68
|
+
LOCK TABLES `items` WRITE;
|
69
|
+
/*!40000 ALTER TABLE `items` DISABLE KEYS */;
|
70
|
+
|
71
|
+
INSERT INTO `items` (`id`, `category_id`, `brand_id`)
|
72
|
+
VALUES
|
73
|
+
(X'31',X'32',X'31');
|
74
|
+
|
75
|
+
/*!40000 ALTER TABLE `items` ENABLE KEYS */;
|
76
|
+
UNLOCK TABLES;
|
77
|
+
|
78
|
+
|
79
|
+
# テーブルのダンプ orders
|
80
|
+
# ------------------------------------------------------------
|
81
|
+
|
82
|
+
DROP TABLE IF EXISTS `orders`;
|
83
|
+
|
84
|
+
CREATE TABLE `orders` (
|
85
|
+
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
|
86
|
+
`user_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
|
87
|
+
`item_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
|
88
|
+
PRIMARY KEY (`id`)
|
89
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
|
90
|
+
|
91
|
+
LOCK TABLES `orders` WRITE;
|
92
|
+
/*!40000 ALTER TABLE `orders` DISABLE KEYS */;
|
93
|
+
|
94
|
+
INSERT INTO `orders` (`id`, `user_id`, `item_id`)
|
95
|
+
VALUES
|
96
|
+
(X'31',X'31',X'31');
|
97
|
+
|
98
|
+
/*!40000 ALTER TABLE `orders` ENABLE KEYS */;
|
99
|
+
UNLOCK TABLES;
|
100
|
+
|
101
|
+
|
102
|
+
# テーブルのダンプ user_profiles
|
103
|
+
# ------------------------------------------------------------
|
104
|
+
|
105
|
+
DROP TABLE IF EXISTS `user_profiles`;
|
106
|
+
|
107
|
+
CREATE TABLE `user_profiles` (
|
108
|
+
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
|
109
|
+
`name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
|
110
|
+
PRIMARY KEY (`id`)
|
111
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
112
|
+
|
113
|
+
LOCK TABLES `user_profiles` WRITE;
|
114
|
+
/*!40000 ALTER TABLE `user_profiles` DISABLE KEYS */;
|
115
|
+
|
116
|
+
INSERT INTO `user_profiles` (`id`, `name`)
|
117
|
+
VALUES
|
118
|
+
(X'31',X'7573657231');
|
119
|
+
|
120
|
+
/*!40000 ALTER TABLE `user_profiles` ENABLE KEYS */;
|
121
|
+
UNLOCK TABLES;
|
122
|
+
|
123
|
+
|
124
|
+
# テーブルのダンプ users
|
125
|
+
# ------------------------------------------------------------
|
126
|
+
|
127
|
+
DROP TABLE IF EXISTS `users`;
|
128
|
+
|
129
|
+
CREATE TABLE `users` (
|
130
|
+
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
|
131
|
+
`login_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
|
132
|
+
`profile_id` int DEFAULT NULL,
|
133
|
+
PRIMARY KEY (`id`)
|
134
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
|
135
|
+
|
136
|
+
LOCK TABLES `users` WRITE;
|
137
|
+
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
|
138
|
+
|
139
|
+
INSERT INTO `users` (`id`, `login_id`, `profile_id`)
|
140
|
+
VALUES
|
141
|
+
(X'31',X'7573657231',1);
|
142
|
+
|
143
|
+
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
|
144
|
+
UNLOCK TABLES;
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
149
|
+
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
150
|
+
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
151
|
+
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
152
|
+
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
153
|
+
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record_mysql_repl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiroki Kishi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 11.1.3
|
20
20
|
type: :development
|
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:
|
26
|
+
version: 11.1.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: solargraph
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.50.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.50.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: activerecord
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -56,16 +56,16 @@ dependencies:
|
|
56
56
|
name: activesupport
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '7.2'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '7.2'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: awesome_print
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,30 +98,30 @@ dependencies:
|
|
98
98
|
name: colorize
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '1.1'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '1.1'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: csv
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - "
|
115
|
+
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
117
|
+
version: 3.3.0
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- - "
|
122
|
+
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
124
|
+
version: 3.3.0
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: mysql2
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,30 +140,30 @@ dependencies:
|
|
140
140
|
name: net-ssh
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- - "
|
143
|
+
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: '
|
145
|
+
version: '7.3'
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- - "
|
150
|
+
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: '
|
152
|
+
version: '7.3'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: net-ssh-gateway
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- - "
|
157
|
+
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: '0'
|
159
|
+
version: '2.0'
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- - "
|
164
|
+
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: '0'
|
166
|
+
version: '2.0'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: pry
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -209,17 +209,56 @@ dependencies:
|
|
209
209
|
description: MySQL REPL featured by ActiveRecord and Pry
|
210
210
|
email:
|
211
211
|
- noga.highland@gmail.com
|
212
|
-
executables:
|
212
|
+
executables:
|
213
|
+
- army
|
213
214
|
extensions: []
|
214
215
|
extra_rdoc_files: []
|
215
|
-
files:
|
216
|
-
|
216
|
+
files:
|
217
|
+
- ".rspec"
|
218
|
+
- ".standard.yml"
|
219
|
+
- CHANGELOG.md
|
220
|
+
- CODE_OF_CONDUCT.md
|
221
|
+
- LICENSE.txt
|
222
|
+
- README.md
|
223
|
+
- Rakefile
|
224
|
+
- exe/army
|
225
|
+
- json_schemas/army_schema.json
|
226
|
+
- json_schemas/association_schema.json
|
227
|
+
- json_schemas/databases_schema.json
|
228
|
+
- lib/active_record_mysql_repl.rb
|
229
|
+
- lib/active_record_mysql_repl/cli.rb
|
230
|
+
- lib/active_record_mysql_repl/cli/erd.rb
|
231
|
+
- lib/active_record_mysql_repl/cli/main.rb
|
232
|
+
- lib/active_record_mysql_repl/cli/options.rb
|
233
|
+
- lib/active_record_mysql_repl/cli/zsh_completion.rb
|
234
|
+
- lib/active_record_mysql_repl/config.rb
|
235
|
+
- lib/active_record_mysql_repl/database.rb
|
236
|
+
- lib/active_record_mysql_repl/database/association.rb
|
237
|
+
- lib/active_record_mysql_repl/database/association/analysis.rb
|
238
|
+
- lib/active_record_mysql_repl/database/association/definition.rb
|
239
|
+
- lib/active_record_mysql_repl/database/configs.rb
|
240
|
+
- lib/active_record_mysql_repl/database/connection.rb
|
241
|
+
- lib/active_record_mysql_repl/database/loader.rb
|
242
|
+
- lib/active_record_mysql_repl/extensions.rb
|
243
|
+
- lib/active_record_mysql_repl/extensions/active_record.rb
|
244
|
+
- lib/active_record_mysql_repl/extensions/global.rb
|
245
|
+
- lib/active_record_mysql_repl/extensions/hash.rb
|
246
|
+
- lib/active_record_mysql_repl/extensions/object.rb
|
247
|
+
- lib/active_record_mysql_repl/extensions/tabler.rb
|
248
|
+
- lib/active_record_mysql_repl/ssh_tunnel.rb
|
249
|
+
- lib/active_record_mysql_repl/version.rb
|
250
|
+
- sample_config/.army.sample.yml
|
251
|
+
- sample_config/.pryrc.sample
|
252
|
+
- sample_config/associations.sample.yml
|
253
|
+
- sample_config/databases.sample.yml
|
254
|
+
- sample_config/sample_db.sql
|
255
|
+
homepage: https://github.com/nogahighland/active_record_mysql_repl
|
217
256
|
licenses:
|
218
257
|
- MIT
|
219
258
|
metadata:
|
220
|
-
homepage_uri: https://github.com/nogahighland/
|
221
|
-
source_code_uri: https://github.com/nogahighland/
|
222
|
-
changelog_uri: https://github.com/nogahighland/
|
259
|
+
homepage_uri: https://github.com/nogahighland/active_record_mysql_repl
|
260
|
+
source_code_uri: https://github.com/nogahighland/active_record_mysql_repl
|
261
|
+
changelog_uri: https://github.com/nogahighland/active_record_mysql_repl/CHANGELOG.md
|
223
262
|
post_install_message:
|
224
263
|
rdoc_options: []
|
225
264
|
require_paths:
|