@hesed/mysql 0.5.1 → 0.6.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.
- package/README.md +53 -50
- package/dist/base-command.d.ts +0 -2
- package/dist/base-command.js +0 -13
- package/dist/commands/mysql/auth/add.js +14 -0
- package/dist/commands/mysql/auth/update.js +14 -0
- package/dist/commands/mysql/databases.d.ts +4 -5
- package/dist/commands/mysql/databases.js +7 -8
- package/dist/commands/mysql/describe-table.d.ts +3 -2
- package/dist/commands/mysql/describe-table.js +6 -9
- package/dist/commands/mysql/{explain-query.d.ts → explain.d.ts} +3 -2
- package/dist/commands/mysql/{explain-query.js → explain.js} +6 -9
- package/dist/commands/mysql/indexes.d.ts +3 -2
- package/dist/commands/mysql/indexes.js +6 -9
- package/dist/commands/mysql/query.d.ts +3 -2
- package/dist/commands/mysql/query.js +13 -16
- package/dist/commands/mysql/tables.d.ts +4 -4
- package/dist/commands/mysql/tables.js +7 -7
- package/dist/mysql/config-loader.d.ts +4 -0
- package/dist/mysql/database.d.ts +39 -30
- package/dist/mysql/mysql-client.js +2 -0
- package/dist/mysql/mysql-utils.d.ts +6 -2
- package/dist/mysql/mysql-utils.js +149 -57
- package/oclif.manifest.json +77 -63
- package/package.json +2 -2
package/oclif.manifest.json
CHANGED
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"description": "Describe the structure of a MySQL table",
|
|
55
55
|
"examples": [
|
|
56
56
|
"<%= config.bin %> <%= command.id %> users",
|
|
57
|
-
"<%= config.bin %> <%= command.id %> orders --
|
|
57
|
+
"<%= config.bin %> <%= command.id %> orders --toon -p prod"
|
|
58
58
|
],
|
|
59
59
|
"flags": {
|
|
60
60
|
"json": {
|
|
@@ -64,19 +64,6 @@
|
|
|
64
64
|
"allowNo": false,
|
|
65
65
|
"type": "boolean"
|
|
66
66
|
},
|
|
67
|
-
"format": {
|
|
68
|
-
"description": "Output format",
|
|
69
|
-
"name": "format",
|
|
70
|
-
"default": "table",
|
|
71
|
-
"hasDynamicHelp": false,
|
|
72
|
-
"multiple": false,
|
|
73
|
-
"options": [
|
|
74
|
-
"table",
|
|
75
|
-
"json",
|
|
76
|
-
"toon"
|
|
77
|
-
],
|
|
78
|
-
"type": "option"
|
|
79
|
-
},
|
|
80
67
|
"profile": {
|
|
81
68
|
"char": "p",
|
|
82
69
|
"description": "Database profile name from config",
|
|
@@ -85,6 +72,13 @@
|
|
|
85
72
|
"hasDynamicHelp": false,
|
|
86
73
|
"multiple": false,
|
|
87
74
|
"type": "option"
|
|
75
|
+
},
|
|
76
|
+
"toon": {
|
|
77
|
+
"description": "Format output as toon",
|
|
78
|
+
"name": "toon",
|
|
79
|
+
"required": false,
|
|
80
|
+
"allowNo": false,
|
|
81
|
+
"type": "boolean"
|
|
88
82
|
}
|
|
89
83
|
},
|
|
90
84
|
"hasDynamicHelp": false,
|
|
@@ -103,7 +97,7 @@
|
|
|
103
97
|
"describe-table.js"
|
|
104
98
|
]
|
|
105
99
|
},
|
|
106
|
-
"mysql:explain
|
|
100
|
+
"mysql:explain": {
|
|
107
101
|
"aliases": [],
|
|
108
102
|
"args": {
|
|
109
103
|
"query": {
|
|
@@ -115,7 +109,7 @@
|
|
|
115
109
|
"description": "Show the execution plan for a MySQL query",
|
|
116
110
|
"examples": [
|
|
117
111
|
"<%= config.bin %> <%= command.id %> \"SELECT * FROM users WHERE id = 1\"",
|
|
118
|
-
"<%= config.bin %> <%= command.id %> \"SELECT * FROM orders JOIN users ON orders.user_id = users.id\" --
|
|
112
|
+
"<%= config.bin %> <%= command.id %> \"SELECT * FROM orders JOIN users ON orders.user_id = users.id\" --json"
|
|
119
113
|
],
|
|
120
114
|
"flags": {
|
|
121
115
|
"json": {
|
|
@@ -125,19 +119,6 @@
|
|
|
125
119
|
"allowNo": false,
|
|
126
120
|
"type": "boolean"
|
|
127
121
|
},
|
|
128
|
-
"format": {
|
|
129
|
-
"description": "Output format",
|
|
130
|
-
"name": "format",
|
|
131
|
-
"default": "table",
|
|
132
|
-
"hasDynamicHelp": false,
|
|
133
|
-
"multiple": false,
|
|
134
|
-
"options": [
|
|
135
|
-
"table",
|
|
136
|
-
"json",
|
|
137
|
-
"toon"
|
|
138
|
-
],
|
|
139
|
-
"type": "option"
|
|
140
|
-
},
|
|
141
122
|
"profile": {
|
|
142
123
|
"char": "p",
|
|
143
124
|
"description": "Database profile name from config",
|
|
@@ -146,11 +127,18 @@
|
|
|
146
127
|
"hasDynamicHelp": false,
|
|
147
128
|
"multiple": false,
|
|
148
129
|
"type": "option"
|
|
130
|
+
},
|
|
131
|
+
"toon": {
|
|
132
|
+
"description": "Format output as toon",
|
|
133
|
+
"name": "toon",
|
|
134
|
+
"required": false,
|
|
135
|
+
"allowNo": false,
|
|
136
|
+
"type": "boolean"
|
|
149
137
|
}
|
|
150
138
|
},
|
|
151
139
|
"hasDynamicHelp": false,
|
|
152
140
|
"hiddenAliases": [],
|
|
153
|
-
"id": "mysql:explain
|
|
141
|
+
"id": "mysql:explain",
|
|
154
142
|
"pluginAlias": "@hesed/mysql",
|
|
155
143
|
"pluginName": "@hesed/mysql",
|
|
156
144
|
"pluginType": "core",
|
|
@@ -161,7 +149,7 @@
|
|
|
161
149
|
"dist",
|
|
162
150
|
"commands",
|
|
163
151
|
"mysql",
|
|
164
|
-
"explain
|
|
152
|
+
"explain.js"
|
|
165
153
|
]
|
|
166
154
|
},
|
|
167
155
|
"mysql:indexes": {
|
|
@@ -176,7 +164,7 @@
|
|
|
176
164
|
"description": "Show indexes for a MySQL table",
|
|
177
165
|
"examples": [
|
|
178
166
|
"<%= config.bin %> <%= command.id %> users",
|
|
179
|
-
"<%= config.bin %> <%= command.id %> orders --
|
|
167
|
+
"<%= config.bin %> <%= command.id %> orders --json -p prod"
|
|
180
168
|
],
|
|
181
169
|
"flags": {
|
|
182
170
|
"json": {
|
|
@@ -186,19 +174,6 @@
|
|
|
186
174
|
"allowNo": false,
|
|
187
175
|
"type": "boolean"
|
|
188
176
|
},
|
|
189
|
-
"format": {
|
|
190
|
-
"description": "Output format",
|
|
191
|
-
"name": "format",
|
|
192
|
-
"default": "table",
|
|
193
|
-
"hasDynamicHelp": false,
|
|
194
|
-
"multiple": false,
|
|
195
|
-
"options": [
|
|
196
|
-
"table",
|
|
197
|
-
"json",
|
|
198
|
-
"toon"
|
|
199
|
-
],
|
|
200
|
-
"type": "option"
|
|
201
|
-
},
|
|
202
177
|
"profile": {
|
|
203
178
|
"char": "p",
|
|
204
179
|
"description": "Database profile name from config",
|
|
@@ -207,6 +182,13 @@
|
|
|
207
182
|
"hasDynamicHelp": false,
|
|
208
183
|
"multiple": false,
|
|
209
184
|
"type": "option"
|
|
185
|
+
},
|
|
186
|
+
"toon": {
|
|
187
|
+
"description": "Format output as toon",
|
|
188
|
+
"name": "toon",
|
|
189
|
+
"required": false,
|
|
190
|
+
"allowNo": false,
|
|
191
|
+
"type": "boolean"
|
|
210
192
|
}
|
|
211
193
|
},
|
|
212
194
|
"hasDynamicHelp": false,
|
|
@@ -236,8 +218,8 @@
|
|
|
236
218
|
},
|
|
237
219
|
"description": "Execute a SQL query against a MySQL database",
|
|
238
220
|
"examples": [
|
|
239
|
-
"<%= config.bin %> <%= command.id %> \"SELECT * FROM users LIMIT 10\"",
|
|
240
|
-
"<%= config.bin %> <%= command.id %> \"UPDATE users SET email = 'user@email.com' WHERE id = 999\"
|
|
221
|
+
"<%= config.bin %> <%= command.id %> \"SELECT * FROM users LIMIT 10\" --json",
|
|
222
|
+
"<%= config.bin %> <%= command.id %> \"UPDATE users SET email = 'user@email.com' WHERE id = 999\"",
|
|
241
223
|
"<%= config.bin %> <%= command.id %> \"DELETE FROM sessions\" -p prod --skip-confirmation"
|
|
242
224
|
],
|
|
243
225
|
"flags": {
|
|
@@ -248,20 +230,6 @@
|
|
|
248
230
|
"allowNo": false,
|
|
249
231
|
"type": "boolean"
|
|
250
232
|
},
|
|
251
|
-
"format": {
|
|
252
|
-
"description": "Output format",
|
|
253
|
-
"name": "format",
|
|
254
|
-
"default": "table",
|
|
255
|
-
"hasDynamicHelp": false,
|
|
256
|
-
"multiple": false,
|
|
257
|
-
"options": [
|
|
258
|
-
"table",
|
|
259
|
-
"json",
|
|
260
|
-
"csv",
|
|
261
|
-
"toon"
|
|
262
|
-
],
|
|
263
|
-
"type": "option"
|
|
264
|
-
},
|
|
265
233
|
"profile": {
|
|
266
234
|
"char": "p",
|
|
267
235
|
"description": "Database profile name from config",
|
|
@@ -276,6 +244,13 @@
|
|
|
276
244
|
"name": "skip-confirmation",
|
|
277
245
|
"allowNo": false,
|
|
278
246
|
"type": "boolean"
|
|
247
|
+
},
|
|
248
|
+
"toon": {
|
|
249
|
+
"description": "Format output as toon",
|
|
250
|
+
"name": "toon",
|
|
251
|
+
"required": false,
|
|
252
|
+
"allowNo": false,
|
|
253
|
+
"type": "boolean"
|
|
279
254
|
}
|
|
280
255
|
},
|
|
281
256
|
"hasDynamicHelp": false,
|
|
@@ -303,6 +278,13 @@
|
|
|
303
278
|
"<%= config.bin %> <%= command.id %> -p local"
|
|
304
279
|
],
|
|
305
280
|
"flags": {
|
|
281
|
+
"json": {
|
|
282
|
+
"description": "Format output as json.",
|
|
283
|
+
"helpGroup": "GLOBAL",
|
|
284
|
+
"name": "json",
|
|
285
|
+
"allowNo": false,
|
|
286
|
+
"type": "boolean"
|
|
287
|
+
},
|
|
306
288
|
"profile": {
|
|
307
289
|
"char": "p",
|
|
308
290
|
"description": "Database profile name from config",
|
|
@@ -320,7 +302,7 @@
|
|
|
320
302
|
"pluginName": "@hesed/mysql",
|
|
321
303
|
"pluginType": "core",
|
|
322
304
|
"strict": true,
|
|
323
|
-
"enableJsonFlag":
|
|
305
|
+
"enableJsonFlag": true,
|
|
324
306
|
"isESM": true,
|
|
325
307
|
"relativePath": [
|
|
326
308
|
"dist",
|
|
@@ -402,6 +384,22 @@
|
|
|
402
384
|
"required": true,
|
|
403
385
|
"allowNo": false,
|
|
404
386
|
"type": "boolean"
|
|
387
|
+
},
|
|
388
|
+
"maxConcurrentQueries": {
|
|
389
|
+
"description": "Max concurrent queries for this profile",
|
|
390
|
+
"name": "maxConcurrentQueries",
|
|
391
|
+
"required": true,
|
|
392
|
+
"hasDynamicHelp": false,
|
|
393
|
+
"multiple": false,
|
|
394
|
+
"type": "option"
|
|
395
|
+
},
|
|
396
|
+
"queryQueueTimeoutMs": {
|
|
397
|
+
"description": "Milliseconds a query may wait for a free query slot before failing",
|
|
398
|
+
"name": "queryQueueTimeoutMs",
|
|
399
|
+
"required": true,
|
|
400
|
+
"hasDynamicHelp": false,
|
|
401
|
+
"multiple": false,
|
|
402
|
+
"type": "option"
|
|
405
403
|
}
|
|
406
404
|
},
|
|
407
405
|
"hasDynamicHelp": false,
|
|
@@ -655,6 +653,22 @@
|
|
|
655
653
|
"required": true,
|
|
656
654
|
"allowNo": false,
|
|
657
655
|
"type": "boolean"
|
|
656
|
+
},
|
|
657
|
+
"maxConcurrentQueries": {
|
|
658
|
+
"description": "Max concurrent queries for this profile",
|
|
659
|
+
"name": "maxConcurrentQueries",
|
|
660
|
+
"required": true,
|
|
661
|
+
"hasDynamicHelp": false,
|
|
662
|
+
"multiple": false,
|
|
663
|
+
"type": "option"
|
|
664
|
+
},
|
|
665
|
+
"queryQueueTimeoutMs": {
|
|
666
|
+
"description": "Milliseconds a query may wait for a free query slot before failing",
|
|
667
|
+
"name": "queryQueueTimeoutMs",
|
|
668
|
+
"required": true,
|
|
669
|
+
"hasDynamicHelp": false,
|
|
670
|
+
"multiple": false,
|
|
671
|
+
"type": "option"
|
|
658
672
|
}
|
|
659
673
|
},
|
|
660
674
|
"hasDynamicHelp": false,
|
|
@@ -675,5 +689,5 @@
|
|
|
675
689
|
]
|
|
676
690
|
}
|
|
677
691
|
},
|
|
678
|
-
"version": "0.
|
|
692
|
+
"version": "0.6.0"
|
|
679
693
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hesed/mysql",
|
|
3
3
|
"description": "CLI for MySQL database interaction",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.0",
|
|
5
5
|
"author": "Hesed",
|
|
6
6
|
"bin": {
|
|
7
7
|
"mq": "./bin/run.js"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
],
|
|
50
50
|
"homepage": "https://github.com/hesedcasa/mysql",
|
|
51
51
|
"keywords": [
|
|
52
|
-
"
|
|
52
|
+
"mysql"
|
|
53
53
|
],
|
|
54
54
|
"license": "Apache-2.0",
|
|
55
55
|
"main": "dist/index.js",
|