@hesed/mysql 0.2.2 → 0.3.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 +107 -32
- package/dist/commands/mysql/auth/add.d.ts +2 -18
- package/dist/commands/mysql/auth/add.js +16 -57
- package/dist/commands/mysql/auth/delete.d.ts +2 -0
- package/dist/commands/mysql/auth/delete.js +2 -0
- package/dist/commands/mysql/auth/list.d.ts +2 -0
- package/dist/commands/mysql/auth/list.js +2 -0
- package/dist/commands/mysql/auth/profile.d.ts +2 -0
- package/dist/commands/mysql/auth/profile.js +2 -0
- package/dist/commands/mysql/auth/test.d.ts +2 -12
- package/dist/commands/mysql/auth/test.js +16 -41
- package/dist/commands/mysql/auth/update.d.ts +2 -18
- package/dist/commands/mysql/auth/update.js +16 -74
- package/dist/commands/mysql/databases.js +2 -10
- package/dist/commands/mysql/describe-table.js +2 -10
- package/dist/commands/mysql/explain-query.js +2 -10
- package/dist/commands/mysql/indexes.js +2 -10
- package/dist/commands/mysql/query.js +2 -10
- package/dist/commands/mysql/tables.js +2 -10
- package/dist/mysql/config-loader.d.ts +8 -17
- package/dist/mysql/config-loader.js +0 -7
- package/dist/mysql/database.d.ts +0 -31
- package/dist/mysql/database.js +0 -4
- package/dist/mysql/formatters.d.ts +5 -0
- package/dist/mysql/formatters.js +76 -0
- package/dist/mysql/index.d.ts +1 -3
- package/dist/mysql/index.js +1 -1
- package/dist/mysql/mysql-client.d.ts +8 -57
- package/dist/mysql/mysql-client.js +44 -101
- package/dist/mysql/mysql-utils.d.ts +1 -51
- package/dist/mysql/mysql-utils.js +8 -168
- package/dist/mysql/query-validator.d.ts +0 -19
- package/dist/mysql/query-validator.js +0 -19
- package/oclif.manifest.json +176 -59
- package/package.json +3 -2
- package/dist/config.d.ts +0 -13
- package/dist/config.js +0 -18
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hesed/mysql",
|
|
3
3
|
"description": "CLI for MySQL database interaction",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"author": "Hesed",
|
|
6
6
|
"bin": {
|
|
7
7
|
"mq": "./bin/run.js"
|
|
8
8
|
},
|
|
9
9
|
"bugs": "https://github.com/hesedcasa/mysql/issues",
|
|
10
10
|
"dependencies": {
|
|
11
|
+
"@hesed/plugin-lib": "^0.7.0",
|
|
11
12
|
"@inquirer/prompts": "^8.3.0",
|
|
12
13
|
"@oclif/core": "^4",
|
|
13
14
|
"@toon-format/toon": "^2.1.0",
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
"oclif": "^4",
|
|
34
35
|
"prettier": "^3.8.1",
|
|
35
36
|
"shx": "^0.4.0",
|
|
36
|
-
"sinon": "^
|
|
37
|
+
"sinon": "^22.0.0",
|
|
37
38
|
"ts-node": "^10",
|
|
38
39
|
"ts-prune": "^0.10.3",
|
|
39
40
|
"typescript": "^5"
|
package/dist/config.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface DatabaseProfile {
|
|
2
|
-
database: string;
|
|
3
|
-
host: string;
|
|
4
|
-
password: string;
|
|
5
|
-
port: number;
|
|
6
|
-
ssl?: boolean;
|
|
7
|
-
user: string;
|
|
8
|
-
}
|
|
9
|
-
export interface MySQLJsonConfig {
|
|
10
|
-
defaultProfile: string;
|
|
11
|
-
profiles: Record<string, DatabaseProfile>;
|
|
12
|
-
}
|
|
13
|
-
export declare function readConfig(configDir: string, log: (message: string) => void): Promise<MySQLJsonConfig | undefined>;
|
package/dist/config.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { default as fs } from 'fs-extra';
|
|
2
|
-
import { default as path } from 'node:path';
|
|
3
|
-
export async function readConfig(configDir, log) {
|
|
4
|
-
const configPath = path.join(configDir, 'mysql-config.json');
|
|
5
|
-
try {
|
|
6
|
-
return await fs.readJSON(configPath);
|
|
7
|
-
}
|
|
8
|
-
catch (error) {
|
|
9
|
-
const msg = error instanceof Error ? error.message : String(error);
|
|
10
|
-
if (msg.toLowerCase().includes('no such file or directory')) {
|
|
11
|
-
log('Missing connection config');
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
log(msg);
|
|
15
|
-
}
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
18
|
-
}
|