@berthojoris/mcp-mysql-server 1.43.5 → 1.44.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/CHANGELOG.md +22 -0
- package/DOCUMENTATIONS.md +19 -3
- package/README.md +7 -1
- package/bin/mcp-mysql.js +168 -168
- package/dist/cache/queryCache.js +1 -1
- package/dist/config/config.js +2 -1
- package/dist/config/featureConfig.d.ts +5 -0
- package/dist/config/featureConfig.js +11 -13
- package/dist/db/connection.d.ts +8 -1
- package/dist/db/connection.js +19 -14
- package/dist/mcp-server.js +30 -302
- package/dist/security/securityLayer.d.ts +21 -2
- package/dist/security/securityLayer.js +151 -21
- package/dist/tools/toolArgumentValidation.js +22 -22
- package/dist/tools/toolRegistry.d.ts +1 -1
- package/dist/tools/toolRegistry.js +7 -1
- package/manifest.json +1 -1
- package/package.json +86 -78
- package/dist/auth/authService.d.ts +0 -29
- package/dist/auth/authService.js +0 -114
- package/dist/tools/backupRestoreTools.d.ts +0 -18
- package/dist/tools/backupRestoreTools.js +0 -70
- package/dist/tools/documentationGeneratorTools.d.ts +0 -145
- package/dist/tools/documentationGeneratorTools.js +0 -820
- package/dist/tools/forecastingTools.d.ts +0 -36
- package/dist/tools/forecastingTools.js +0 -256
- package/dist/tools/functionTools.d.ts +0 -87
- package/dist/tools/functionTools.js +0 -358
- package/dist/tools/indexRecommendationTools.d.ts +0 -50
- package/dist/tools/indexRecommendationTools.js +0 -451
- package/dist/tools/intelligentQueryTools.d.ts +0 -94
- package/dist/tools/intelligentQueryTools.js +0 -713
- package/dist/tools/performanceTools.d.ts +0 -76
- package/dist/tools/performanceTools.js +0 -505
- package/dist/tools/processTools.d.ts +0 -61
- package/dist/tools/processTools.js +0 -181
- package/dist/tools/queryVisualizationTools.d.ts +0 -22
- package/dist/tools/queryVisualizationTools.js +0 -155
- package/dist/tools/schemaDesignTools.d.ts +0 -67
- package/dist/tools/schemaDesignTools.js +0 -359
- package/dist/tools/schemaPatternTools.d.ts +0 -19
- package/dist/tools/schemaPatternTools.js +0 -253
- package/dist/tools/schemaVersioningTools.d.ts +0 -138
- package/dist/tools/schemaVersioningTools.js +0 -1008
- package/dist/tools/securityAuditTools.d.ts +0 -39
- package/dist/tools/securityAuditTools.js +0 -319
- package/dist/tools/smartDiscoveryTools.d.ts +0 -163
- package/dist/tools/smartDiscoveryTools.js +0 -750
- package/dist/tools/testDataTools.d.ts +0 -26
- package/dist/tools/testDataTools.js +0 -325
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import SecurityLayer from "../security/securityLayer";
|
|
2
|
-
/**
|
|
3
|
-
* Schema Versioning and Migrations Tools for MySQL MCP Server
|
|
4
|
-
* Provides utilities for managing database schema versions and migrations
|
|
5
|
-
*/
|
|
6
|
-
export declare class SchemaVersioningTools {
|
|
7
|
-
private db;
|
|
8
|
-
private security;
|
|
9
|
-
private migrationsTable;
|
|
10
|
-
constructor(security: SecurityLayer);
|
|
11
|
-
/**
|
|
12
|
-
* Validate database access
|
|
13
|
-
*/
|
|
14
|
-
private validateDatabaseAccess;
|
|
15
|
-
/**
|
|
16
|
-
* Generate a migration version based on timestamp
|
|
17
|
-
*/
|
|
18
|
-
private generateVersion;
|
|
19
|
-
/**
|
|
20
|
-
* Escape string value for SQL
|
|
21
|
-
*/
|
|
22
|
-
private escapeValue;
|
|
23
|
-
/**
|
|
24
|
-
* Initialize the migrations tracking table if it doesn't exist
|
|
25
|
-
*/
|
|
26
|
-
initMigrationsTable(params: {
|
|
27
|
-
database?: string;
|
|
28
|
-
}): Promise<{
|
|
29
|
-
status: string;
|
|
30
|
-
data?: any;
|
|
31
|
-
error?: string;
|
|
32
|
-
}>;
|
|
33
|
-
/**
|
|
34
|
-
* Create a new migration entry
|
|
35
|
-
*/
|
|
36
|
-
createMigration(params: {
|
|
37
|
-
name: string;
|
|
38
|
-
up_sql: string;
|
|
39
|
-
down_sql?: string;
|
|
40
|
-
description?: string;
|
|
41
|
-
version?: string;
|
|
42
|
-
database?: string;
|
|
43
|
-
}): Promise<{
|
|
44
|
-
status: string;
|
|
45
|
-
data?: any;
|
|
46
|
-
error?: string;
|
|
47
|
-
}>;
|
|
48
|
-
/**
|
|
49
|
-
* Generate a simple checksum for SQL content
|
|
50
|
-
*/
|
|
51
|
-
private generateChecksum;
|
|
52
|
-
/**
|
|
53
|
-
* Apply pending migrations
|
|
54
|
-
*/
|
|
55
|
-
applyMigrations(params: {
|
|
56
|
-
target_version?: string;
|
|
57
|
-
dry_run?: boolean;
|
|
58
|
-
database?: string;
|
|
59
|
-
}): Promise<{
|
|
60
|
-
status: string;
|
|
61
|
-
data?: any;
|
|
62
|
-
error?: string;
|
|
63
|
-
}>;
|
|
64
|
-
/**
|
|
65
|
-
* Split SQL content into individual statements
|
|
66
|
-
*/
|
|
67
|
-
private splitSqlStatements;
|
|
68
|
-
/**
|
|
69
|
-
* Rollback the last applied migration or to a specific version
|
|
70
|
-
*/
|
|
71
|
-
rollbackMigration(params: {
|
|
72
|
-
target_version?: string;
|
|
73
|
-
steps?: number;
|
|
74
|
-
dry_run?: boolean;
|
|
75
|
-
database?: string;
|
|
76
|
-
}): Promise<{
|
|
77
|
-
status: string;
|
|
78
|
-
data?: any;
|
|
79
|
-
error?: string;
|
|
80
|
-
}>;
|
|
81
|
-
/**
|
|
82
|
-
* Get migration history and status
|
|
83
|
-
*/
|
|
84
|
-
getMigrationStatus(params: {
|
|
85
|
-
version?: string;
|
|
86
|
-
status?: "pending" | "applied" | "failed" | "rolled_back";
|
|
87
|
-
limit?: number;
|
|
88
|
-
database?: string;
|
|
89
|
-
}): Promise<{
|
|
90
|
-
status: string;
|
|
91
|
-
data?: any;
|
|
92
|
-
error?: string;
|
|
93
|
-
}>;
|
|
94
|
-
/**
|
|
95
|
-
* Get the current schema version
|
|
96
|
-
*/
|
|
97
|
-
getSchemaVersion(params: {
|
|
98
|
-
database?: string;
|
|
99
|
-
}): Promise<{
|
|
100
|
-
status: string;
|
|
101
|
-
data?: any;
|
|
102
|
-
error?: string;
|
|
103
|
-
}>;
|
|
104
|
-
/**
|
|
105
|
-
* Validate pending migrations (check for conflicts or issues)
|
|
106
|
-
*/
|
|
107
|
-
validateMigrations(params: {
|
|
108
|
-
database?: string;
|
|
109
|
-
}): Promise<{
|
|
110
|
-
status: string;
|
|
111
|
-
data?: any;
|
|
112
|
-
error?: string;
|
|
113
|
-
}>;
|
|
114
|
-
/**
|
|
115
|
-
* Mark a failed migration as resolved (reset to pending status)
|
|
116
|
-
*/
|
|
117
|
-
resetFailedMigration(params: {
|
|
118
|
-
version: string;
|
|
119
|
-
database?: string;
|
|
120
|
-
}): Promise<{
|
|
121
|
-
status: string;
|
|
122
|
-
data?: any;
|
|
123
|
-
error?: string;
|
|
124
|
-
}>;
|
|
125
|
-
/**
|
|
126
|
-
* Generate a migration from table comparison
|
|
127
|
-
*/
|
|
128
|
-
generateMigrationFromDiff(params: {
|
|
129
|
-
table1: string;
|
|
130
|
-
table2: string;
|
|
131
|
-
migration_name: string;
|
|
132
|
-
database?: string;
|
|
133
|
-
}): Promise<{
|
|
134
|
-
status: string;
|
|
135
|
-
data?: any;
|
|
136
|
-
error?: string;
|
|
137
|
-
}>;
|
|
138
|
-
}
|