sql-preview 0.5.11 → 0.6.2
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 +302 -0
- package/README.md +222 -71
- package/dist/mcp-app.html +99158 -0
- package/media/icon.png +0 -0
- package/out/server/standalone.js +66622 -25047
- package/package.json +53 -357
- package/server.json +58 -0
- package/out/common/errors.js +0 -31
- package/out/common/errors.js.map +0 -1
- package/out/common/types.js +0 -11
- package/out/common/types.js.map +0 -1
- package/out/server/ConsoleLogger.js +0 -46
- package/out/server/ConsoleLogger.js.map +0 -1
- package/out/server/Daemon.js +0 -537
- package/out/server/Daemon.js.map +0 -7
- package/out/server/DaemonMcpServer.js +0 -63
- package/out/server/DaemonMcpServer.js.map +0 -1
- package/out/server/DaemonMcpToolManager.js +0 -433
- package/out/server/DaemonMcpToolManager.js.map +0 -1
- package/out/server/DaemonQueryExecutor.js +0 -96
- package/out/server/DaemonQueryExecutor.js.map +0 -1
- package/out/server/FileConnectionManager.js +0 -108
- package/out/server/FileConnectionManager.js.map +0 -1
- package/out/server/SessionManager.js +0 -103
- package/out/server/SessionManager.js.map +0 -1
- package/out/server/SocketTransport.js +0 -77
- package/out/server/SocketTransport.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sql-preview",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
3
|
+
"version": "0.6.2",
|
|
4
|
+
"mcpName": "io.github.fadnavismehul/sql-preview",
|
|
5
|
+
"description": "Standalone SQL Preview MCP database server for VS Code, Claude Desktop, Cursor, and other MCP clients.",
|
|
6
|
+
"main": "out/server/standalone.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"sql-preview-server": "out/server/standalone.js"
|
|
9
|
+
},
|
|
8
10
|
"repository": {
|
|
9
11
|
"type": "git",
|
|
10
|
-
"url": "https://github.com/fadnavismehul/sql-preview"
|
|
12
|
+
"url": "git+https://github.com/fadnavismehul/sql-preview.git"
|
|
11
13
|
},
|
|
12
14
|
"homepage": "https://github.com/fadnavismehul/sql-preview#readme",
|
|
13
15
|
"bugs": {
|
|
@@ -15,377 +17,71 @@
|
|
|
15
17
|
},
|
|
16
18
|
"keywords": [
|
|
17
19
|
"sql",
|
|
18
|
-
"presto",
|
|
19
|
-
"trino",
|
|
20
20
|
"database",
|
|
21
21
|
"query",
|
|
22
|
+
"postgresql",
|
|
23
|
+
"postgres",
|
|
24
|
+
"mysql",
|
|
25
|
+
"sqlite",
|
|
26
|
+
"duckdb",
|
|
27
|
+
"trino",
|
|
28
|
+
"presto",
|
|
29
|
+
"snowflake",
|
|
30
|
+
"bigquery",
|
|
31
|
+
"mssql",
|
|
32
|
+
"mcp",
|
|
33
|
+
"model-context-protocol",
|
|
34
|
+
"ai",
|
|
35
|
+
"claude",
|
|
36
|
+
"cursor",
|
|
37
|
+
"agent",
|
|
22
38
|
"data",
|
|
23
39
|
"analytics",
|
|
40
|
+
"data-grid",
|
|
41
|
+
"sql-client",
|
|
24
42
|
"results",
|
|
25
43
|
"viewer"
|
|
26
44
|
],
|
|
27
45
|
"engines": {
|
|
28
46
|
"vscode": "^1.80.0"
|
|
29
47
|
},
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"activationEvents": [
|
|
35
|
-
"onLanguage:sql"
|
|
36
|
-
],
|
|
37
|
-
"main": "./out/extension.js",
|
|
38
|
-
"bin": {
|
|
39
|
-
"sql-preview-server": "./out/server/standalone.js"
|
|
48
|
+
"author": "mehul",
|
|
49
|
+
"license": "MIT",
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
40
52
|
},
|
|
41
53
|
"files": [
|
|
42
|
-
"out/server",
|
|
43
|
-
"out/common",
|
|
44
|
-
"package.json",
|
|
45
54
|
"README.md",
|
|
46
|
-
"
|
|
55
|
+
"Changelog.md",
|
|
56
|
+
"LICENSE",
|
|
57
|
+
"server.json",
|
|
58
|
+
"media/icon.png",
|
|
59
|
+
"out/server/standalone.js",
|
|
60
|
+
"dist/mcp-app.html"
|
|
47
61
|
],
|
|
48
|
-
"contributes": {
|
|
49
|
-
"commands": [
|
|
50
|
-
{
|
|
51
|
-
"command": "sql.runQuery",
|
|
52
|
-
"title": "SQL Preview: Run Query"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"command": "sql.runQueryNewTab",
|
|
56
|
-
"title": "SQL Preview: Run Query (+ Tab)"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"command": "sql.runCursorQuery",
|
|
60
|
-
"title": "SQL Preview: Run Query Under Cursor"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"command": "sql.closeTab",
|
|
64
|
-
"title": "Close Tab"
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"command": "sql.closeOtherTabs",
|
|
68
|
-
"title": "Close Other Tabs"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"command": "sql.closeAllTabs",
|
|
72
|
-
"title": "Close All Tabs"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"command": "sql.setPassword",
|
|
76
|
-
"title": "SQL Preview: Set Database Password"
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"command": "sql.clearPassword",
|
|
80
|
-
"title": "SQL Preview: Clear Stored Password"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
"command": "sql.setPasswordFromSettings",
|
|
84
|
-
"title": "Set Password",
|
|
85
|
-
"icon": "$(key)"
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
"command": "sql.mcp.testConnection",
|
|
89
|
-
"title": "SQL Preview: Test MCP Server Connection"
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
"command": "sql.debug.resetSession",
|
|
93
|
-
"title": "SQL Preview: Reset Session (Debug)"
|
|
94
|
-
}
|
|
95
|
-
],
|
|
96
|
-
"viewsContainers": {
|
|
97
|
-
"panel": [
|
|
98
|
-
{
|
|
99
|
-
"id": "sqlResultsContainer",
|
|
100
|
-
"title": "SQL Preview",
|
|
101
|
-
"icon": "media/table.svg"
|
|
102
|
-
}
|
|
103
|
-
]
|
|
104
|
-
},
|
|
105
|
-
"views": {
|
|
106
|
-
"sqlResultsContainer": [
|
|
107
|
-
{
|
|
108
|
-
"id": "sqlResultsView",
|
|
109
|
-
"name": "Results",
|
|
110
|
-
"type": "webview",
|
|
111
|
-
"contextualTitle": "SQL Preview",
|
|
112
|
-
"icon": "media/table.svg"
|
|
113
|
-
}
|
|
114
|
-
]
|
|
115
|
-
},
|
|
116
|
-
"menus": {
|
|
117
|
-
"commandPalette": [
|
|
118
|
-
{
|
|
119
|
-
"command": "sql.setPasswordFromSettings",
|
|
120
|
-
"when": "false"
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
"command": "sql.closeTab",
|
|
124
|
-
"when": "false"
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
"command": "sql.closeOtherTabs",
|
|
128
|
-
"when": "false"
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
"command": "sql.closeAllTabs",
|
|
132
|
-
"when": "false"
|
|
133
|
-
}
|
|
134
|
-
],
|
|
135
|
-
"webview/context": [
|
|
136
|
-
{
|
|
137
|
-
"command": "sql.closeTab",
|
|
138
|
-
"when": "webviewId == 'sqlResultsView'",
|
|
139
|
-
"group": "navigation@1"
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
"command": "sql.closeOtherTabs",
|
|
143
|
-
"when": "webviewId == 'sqlResultsView'",
|
|
144
|
-
"group": "navigation@2"
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
"command": "sql.closeAllTabs",
|
|
148
|
-
"when": "webviewId == 'sqlResultsView'",
|
|
149
|
-
"group": "navigation@3"
|
|
150
|
-
}
|
|
151
|
-
]
|
|
152
|
-
},
|
|
153
|
-
"keybindings": [
|
|
154
|
-
{
|
|
155
|
-
"command": "sql.runQueryNewTab",
|
|
156
|
-
"key": "ctrl+enter",
|
|
157
|
-
"mac": "cmd+enter",
|
|
158
|
-
"when": "editorTextFocus && editorLangId == sql"
|
|
159
|
-
}
|
|
160
|
-
],
|
|
161
|
-
"configuration": {
|
|
162
|
-
"title": "SQL Preview",
|
|
163
|
-
"properties": {
|
|
164
|
-
"sqlPreview.host": {
|
|
165
|
-
"type": "string",
|
|
166
|
-
"default": "localhost",
|
|
167
|
-
"description": "Database server host.",
|
|
168
|
-
"order": 1
|
|
169
|
-
},
|
|
170
|
-
"sqlPreview.port": {
|
|
171
|
-
"type": "number",
|
|
172
|
-
"default": 443,
|
|
173
|
-
"description": "Database server port.",
|
|
174
|
-
"order": 2
|
|
175
|
-
},
|
|
176
|
-
"sqlPreview.user": {
|
|
177
|
-
"type": "string",
|
|
178
|
-
"default": "user",
|
|
179
|
-
"description": "Username for database connection.",
|
|
180
|
-
"order": 3
|
|
181
|
-
},
|
|
182
|
-
"sqlPreview.password": {
|
|
183
|
-
"type": "string",
|
|
184
|
-
"default": "",
|
|
185
|
-
"description": "Click 'Set Password' to securely store your database password. This field shows whether a password is stored.",
|
|
186
|
-
"markdownDescription": "**Secure Password Management**: Click the 'Set Password' button or use Command Palette → `SQL Preview: Set Database Password` to store your password securely. This field will show `[Password Set]` when configured.",
|
|
187
|
-
"editPresentation": "singlelineText",
|
|
188
|
-
"scope": "application",
|
|
189
|
-
"order": 4
|
|
190
|
-
},
|
|
191
|
-
"sqlPreview.catalog": {
|
|
192
|
-
"type": "string",
|
|
193
|
-
"default": "",
|
|
194
|
-
"description": "Default database catalog.",
|
|
195
|
-
"order": 5
|
|
196
|
-
},
|
|
197
|
-
"sqlPreview.schema": {
|
|
198
|
-
"type": "string",
|
|
199
|
-
"default": "",
|
|
200
|
-
"description": "Default database schema.",
|
|
201
|
-
"order": 6
|
|
202
|
-
},
|
|
203
|
-
"sqlPreview.databasePath": {
|
|
204
|
-
"type": "string",
|
|
205
|
-
"default": "",
|
|
206
|
-
"description": "Path to the database file (for SQLite).",
|
|
207
|
-
"order": 6.5
|
|
208
|
-
},
|
|
209
|
-
"sqlPreview.ssl": {
|
|
210
|
-
"type": "boolean",
|
|
211
|
-
"default": false,
|
|
212
|
-
"description": "Enable SSL/TLS for the connection.",
|
|
213
|
-
"order": 7
|
|
214
|
-
},
|
|
215
|
-
"sqlPreview.sslVerify": {
|
|
216
|
-
"type": "boolean",
|
|
217
|
-
"default": true,
|
|
218
|
-
"description": "Verify the server's SSL certificate. Set to false for self-signed certificates (less secure).",
|
|
219
|
-
"order": 8
|
|
220
|
-
},
|
|
221
|
-
"sqlPreview.maxRowsToDisplay": {
|
|
222
|
-
"type": "number",
|
|
223
|
-
"default": 500,
|
|
224
|
-
"description": "Maximum number of rows to display in the results grid. Full results can be exported.",
|
|
225
|
-
"minimum": 1,
|
|
226
|
-
"order": 9
|
|
227
|
-
},
|
|
228
|
-
"sqlPreview.fontSize": {
|
|
229
|
-
"type": "number",
|
|
230
|
-
"default": 0,
|
|
231
|
-
"description": "Font size for the results view in pixels. Set to 0 to inherit from VS Code editor font size.",
|
|
232
|
-
"minimum": 0,
|
|
233
|
-
"maximum": 32,
|
|
234
|
-
"order": 10
|
|
235
|
-
},
|
|
236
|
-
"sqlPreview.tabNaming": {
|
|
237
|
-
"type": "string",
|
|
238
|
-
"enum": [
|
|
239
|
-
"file-sequential",
|
|
240
|
-
"query-snippet"
|
|
241
|
-
],
|
|
242
|
-
"default": "file-sequential",
|
|
243
|
-
"description": "Naming convention for results tabs.",
|
|
244
|
-
"enumDescriptions": [
|
|
245
|
-
"Sequential naming per file (e.g., Result 1, Result 2)",
|
|
246
|
-
"Use the first few characters of the query"
|
|
247
|
-
],
|
|
248
|
-
"order": 11
|
|
249
|
-
},
|
|
250
|
-
"sqlPreview.alwaysRunInNewTab": {
|
|
251
|
-
"type": "boolean",
|
|
252
|
-
"default": false,
|
|
253
|
-
"description": "Always run queries in a new tab instead of reusing the active tab.",
|
|
254
|
-
"order": 11.5
|
|
255
|
-
},
|
|
256
|
-
"sqlPreview.mcpEnabled": {
|
|
257
|
-
"type": "boolean",
|
|
258
|
-
"default": false,
|
|
259
|
-
"description": "(Beta) Enable the MCP Server to allow LLM agents to interact with SQL Preview.",
|
|
260
|
-
"order": 20
|
|
261
|
-
},
|
|
262
|
-
"sqlPreview.mcpSafeMode": {
|
|
263
|
-
"type": "boolean",
|
|
264
|
-
"default": true,
|
|
265
|
-
"description": "(Beta) If enabled, MCP server will only execute read-only queries (SELECT, SHOW, DESCRIBE, etc.)",
|
|
266
|
-
"order": 22
|
|
267
|
-
},
|
|
268
|
-
"sqlPreview.defaultConnector": {
|
|
269
|
-
"type": "string",
|
|
270
|
-
"enum": [
|
|
271
|
-
"trino"
|
|
272
|
-
],
|
|
273
|
-
"default": "trino",
|
|
274
|
-
"description": "Database connector to use.",
|
|
275
|
-
"order": 12
|
|
276
|
-
},
|
|
277
|
-
"sqlPreview.rowHeight": {
|
|
278
|
-
"type": "string",
|
|
279
|
-
"enum": [
|
|
280
|
-
"compact",
|
|
281
|
-
"normal",
|
|
282
|
-
"comfortable"
|
|
283
|
-
],
|
|
284
|
-
"default": "normal",
|
|
285
|
-
"description": "Grid row height density.",
|
|
286
|
-
"order": 15
|
|
287
|
-
},
|
|
288
|
-
"sqlPreview.logLevel": {
|
|
289
|
-
"type": "string",
|
|
290
|
-
"enum": [
|
|
291
|
-
"DEBUG",
|
|
292
|
-
"INFO",
|
|
293
|
-
"WARN",
|
|
294
|
-
"ERROR"
|
|
295
|
-
],
|
|
296
|
-
"default": "INFO",
|
|
297
|
-
"description": "Controls the verbosity of logging.",
|
|
298
|
-
"order": 16
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
},
|
|
303
|
-
"scripts": {
|
|
304
|
-
"vscode:prepublish": "npm run build",
|
|
305
|
-
"compile": "tsc -p ./",
|
|
306
|
-
"watch": "tsc -watch -p ./",
|
|
307
|
-
"package": "vsce package",
|
|
308
|
-
"lint": "eslint src --ext ts",
|
|
309
|
-
"lint:fix": "eslint src --ext ts --fix",
|
|
310
|
-
"format": "prettier --write \"src/**/*.{ts,js,json}\"",
|
|
311
|
-
"format:check": "prettier --check \"src/**/*.{ts,js,json}\"",
|
|
312
|
-
"type-check": "tsc --noEmit",
|
|
313
|
-
"esbuild-base": "esbuild ./src/extension.ts --bundle --outfile=out/extension.js --external:vscode --format=cjs --platform=node",
|
|
314
|
-
"esbuild-daemon": "esbuild ./src/server/Daemon.ts --bundle --outfile=out/server/Daemon.js --platform=node --format=cjs --external:vscode",
|
|
315
|
-
"esbuild-standalone": "esbuild ./src/server/standalone.ts --bundle --outfile=out/server/standalone.js --platform=node --format=cjs --external:vscode --banner:js=\"#!/usr/bin/env node\"",
|
|
316
|
-
"build": "npm run esbuild-base -- --minify && npm run esbuild-daemon -- --minify && npm run esbuild-standalone -- --minify",
|
|
317
|
-
"build-dev": "npm run esbuild-base -- --sourcemap && npm run esbuild-daemon -- --sourcemap",
|
|
318
|
-
"test": "jest --config jest.config.js",
|
|
319
|
-
"test:watch": "jest --config jest.config.js --watch",
|
|
320
|
-
"test:coverage": "jest --config jest.config.js --coverage",
|
|
321
|
-
"test:integration": "node ./out/test/runTest.js",
|
|
322
|
-
"pretest": "npm run quality-check",
|
|
323
|
-
"test:all": "npm run test && npm run test:integration",
|
|
324
|
-
"quality-check": "npm run type-check && npm run lint && npm run format:check",
|
|
325
|
-
"quality-fix": "npm run lint:fix && npm run format",
|
|
326
|
-
"verify-package": "node scripts/verify-package-content.js",
|
|
327
|
-
"publish:vscode": "npm run verify-package && npx vsce publish",
|
|
328
|
-
"publish:vscode:env": "npm run verify-package && dotenv -e .env.local -- npx vsce publish -p $VSCE_PAT",
|
|
329
|
-
"publish:ovsx": "npm run verify-package && npx ovsx publish",
|
|
330
|
-
"publish:ovsx:env": "npm run verify-package && dotenv -e .env.local -- npx ovsx publish -p $OVSX_PAT",
|
|
331
|
-
"publish:all": "npm run publish:vscode && npm run publish:ovsx",
|
|
332
|
-
"prepare": "husky install",
|
|
333
|
-
"probe": "node scripts/probe-presto.mjs",
|
|
334
|
-
"probe:extension": "node scripts/probe-extension-path.mjs",
|
|
335
|
-
"check-changelog": "node scripts/check-changelog.js",
|
|
336
|
-
"typecheck": "npm run type-check",
|
|
337
|
-
"postinstall": "node -e \"try { require('child_process').execSync('bash scripts/install-hooks.sh', {stdio:'inherit'}) } catch(e) {}\""
|
|
338
|
-
},
|
|
339
|
-
"devDependencies": {
|
|
340
|
-
"@types/body-parser": "^1.19.6",
|
|
341
|
-
"@types/cors": "^2.8.19",
|
|
342
|
-
"@types/express": "^5.0.5",
|
|
343
|
-
"@types/glob": "^8.1.0",
|
|
344
|
-
"@types/jest": "^29.5.14",
|
|
345
|
-
"@types/mocha": "^10.0.10",
|
|
346
|
-
"@types/node": "^18.x",
|
|
347
|
-
"@types/pg": "^8.16.0",
|
|
348
|
-
"@types/sinon": "^17.0.4",
|
|
349
|
-
"@types/vscode": "^1.80.0",
|
|
350
|
-
"@typescript-eslint/eslint-plugin": "^5.59.8",
|
|
351
|
-
"@typescript-eslint/parser": "^5.59.8",
|
|
352
|
-
"@vscode/test-electron": "^2.5.2",
|
|
353
|
-
"@vscode/vsce": "^2.19.0",
|
|
354
|
-
"ag-grid-community": "^35.0.0",
|
|
355
|
-
"dotenv-cli": "^7.4.1",
|
|
356
|
-
"esbuild": "^0.17.19",
|
|
357
|
-
"eslint": "^8.41.0",
|
|
358
|
-
"eslint-config-prettier": "^9.1.2",
|
|
359
|
-
"eslint-plugin-prettier": "^5.5.3",
|
|
360
|
-
"glob": "^11.0.1",
|
|
361
|
-
"husky": "^8.0.3",
|
|
362
|
-
"jest": "^29.7.0",
|
|
363
|
-
"lint-staged": "^15.5.2",
|
|
364
|
-
"mocha": "^11.1.0",
|
|
365
|
-
"pg": "^8.17.2",
|
|
366
|
-
"prettier": "^3.6.2",
|
|
367
|
-
"sinon": "^20.0.0",
|
|
368
|
-
"ts-jest": "^29.3.1",
|
|
369
|
-
"typescript": "^5.1.3"
|
|
370
|
-
},
|
|
371
62
|
"dependencies": {
|
|
372
|
-
"@
|
|
63
|
+
"@duckdb/node-api": "^1.5.0-r.1",
|
|
64
|
+
"@google-cloud/bigquery": "^7.9.1",
|
|
65
|
+
"@modelcontextprotocol/ext-apps": "^1.0.1",
|
|
66
|
+
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
67
|
+
"@opentelemetry/api": "^1.9.1",
|
|
68
|
+
"@opentelemetry/exporter-trace-otlp-http": "^0.217.0",
|
|
69
|
+
"@opentelemetry/resources": "^2.7.1",
|
|
70
|
+
"@opentelemetry/sdk-node": "^0.217.0",
|
|
71
|
+
"@opentelemetry/semantic-conventions": "^1.40.0",
|
|
373
72
|
"@types/json-bigint": "^1.0.4",
|
|
374
73
|
"ajv": "^8.17.1",
|
|
375
|
-
"
|
|
74
|
+
"ajv-formats": "^3.0.1",
|
|
75
|
+
"axios": "^1.16.0",
|
|
376
76
|
"body-parser": "^2.2.1",
|
|
377
77
|
"cors": "^2.8.5",
|
|
378
78
|
"express": "^5.1.0",
|
|
379
79
|
"json-bigint": "^1.0.0",
|
|
380
|
-
"
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
"
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
],
|
|
387
|
-
"*.{json,md}": [
|
|
388
|
-
"prettier --write"
|
|
389
|
-
]
|
|
80
|
+
"mssql": "^11.0.1",
|
|
81
|
+
"mysql2": "^3.9.0",
|
|
82
|
+
"pg": "^8.17.2",
|
|
83
|
+
"snowflake-sdk": "^1.15.0",
|
|
84
|
+
"sql.js": "^1.14.1",
|
|
85
|
+
"ws": "^8.19.0"
|
|
390
86
|
}
|
|
391
87
|
}
|
package/server.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.fadnavismehul/sql-preview",
|
|
4
|
+
"title": "SQL Preview",
|
|
5
|
+
"description": "Run governed SQL queries and inspect database schemas from MCP agents.",
|
|
6
|
+
"repository": {
|
|
7
|
+
"url": "https://github.com/fadnavismehul/sql-preview",
|
|
8
|
+
"source": "github",
|
|
9
|
+
"id": "1025027765"
|
|
10
|
+
},
|
|
11
|
+
"version": "0.6.2",
|
|
12
|
+
"websiteUrl": "https://github.com/fadnavismehul/sql-preview#readme",
|
|
13
|
+
"packages": [
|
|
14
|
+
{
|
|
15
|
+
"registryType": "npm",
|
|
16
|
+
"registryBaseUrl": "https://registry.npmjs.org",
|
|
17
|
+
"identifier": "sql-preview",
|
|
18
|
+
"version": "0.6.2",
|
|
19
|
+
"runtimeHint": "npx",
|
|
20
|
+
"runtimeArguments": [
|
|
21
|
+
{
|
|
22
|
+
"type": "positional",
|
|
23
|
+
"value": "-y"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"packageArguments": [
|
|
27
|
+
{
|
|
28
|
+
"type": "named",
|
|
29
|
+
"name": "--stdio",
|
|
30
|
+
"description": "Run SQL Preview using stdio transport for local MCP clients."
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"transport": {
|
|
34
|
+
"type": "stdio"
|
|
35
|
+
},
|
|
36
|
+
"environmentVariables": [
|
|
37
|
+
{
|
|
38
|
+
"name": "SQL_PREVIEW_CONNECTIONS",
|
|
39
|
+
"description": "JSON array of SQL Preview connection profiles for headless use.",
|
|
40
|
+
"format": "string",
|
|
41
|
+
"isSecret": true
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "SQL_PREVIEW_MCP_SAFE_MODE",
|
|
45
|
+
"description": "Set to false to allow mutating SQL. Defaults to true.",
|
|
46
|
+
"format": "boolean",
|
|
47
|
+
"value": "true"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "SQL_PREVIEW_MAX_ROWS",
|
|
51
|
+
"description": "Maximum rows returned by query tools. Defaults to 10000.",
|
|
52
|
+
"format": "number",
|
|
53
|
+
"value": "10000"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
package/out/common/errors.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AuthenticationError = exports.QueryError = exports.ConnectionError = exports.BaseError = void 0;
|
|
4
|
-
class BaseError extends Error {
|
|
5
|
-
constructor(message, details) {
|
|
6
|
-
super(message);
|
|
7
|
-
this.details = details;
|
|
8
|
-
this.name = this.constructor.name;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.BaseError = BaseError;
|
|
12
|
-
class ConnectionError extends BaseError {
|
|
13
|
-
constructor(message, details) {
|
|
14
|
-
super(message, details);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.ConnectionError = ConnectionError;
|
|
18
|
-
class QueryError extends BaseError {
|
|
19
|
-
constructor(message, query, details) {
|
|
20
|
-
super(message, details);
|
|
21
|
-
this.query = query;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.QueryError = QueryError;
|
|
25
|
-
class AuthenticationError extends BaseError {
|
|
26
|
-
constructor(message, details) {
|
|
27
|
-
super(message, details);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.AuthenticationError = AuthenticationError;
|
|
31
|
-
//# sourceMappingURL=errors.js.map
|
package/out/common/errors.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/common/errors.ts"],"names":[],"mappings":";;;AAAA,MAAa,SAAU,SAAQ,KAAK;IAClC,YACE,OAAe,EACC,OAAgB;QAEhC,KAAK,CAAC,OAAO,CAAC,CAAC;QAFC,YAAO,GAAP,OAAO,CAAS;QAGhC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACpC,CAAC;CACF;AARD,8BAQC;AAED,MAAa,eAAgB,SAAQ,SAAS;IAC5C,YAAY,OAAe,EAAE,OAAgB;QAC3C,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1B,CAAC;CACF;AAJD,0CAIC;AAED,MAAa,UAAW,SAAQ,SAAS;IACvC,YACE,OAAe,EACC,KAAc,EAC9B,OAAgB;QAEhB,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAHR,UAAK,GAAL,KAAK,CAAS;IAIhC,CAAC;CACF;AARD,gCAQC;AAED,MAAa,mBAAoB,SAAQ,SAAS;IAChD,YAAY,OAAe,EAAE,OAAgB;QAC3C,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1B,CAAC;CACF;AAJD,kDAIC"}
|
package/out/common/types.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LogLevel = void 0;
|
|
4
|
-
var LogLevel;
|
|
5
|
-
(function (LogLevel) {
|
|
6
|
-
LogLevel["DEBUG"] = "DEBUG";
|
|
7
|
-
LogLevel["INFO"] = "INFO";
|
|
8
|
-
LogLevel["WARN"] = "WARN";
|
|
9
|
-
LogLevel["ERROR"] = "ERROR";
|
|
10
|
-
})(LogLevel || (exports.LogLevel = LogLevel = {}));
|
|
11
|
-
//# sourceMappingURL=types.js.map
|
package/out/common/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/common/types.ts"],"names":[],"mappings":";;;AAkCA,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,2BAAe,CAAA;IACf,yBAAa,CAAA;IACb,yBAAa,CAAA;IACb,2BAAe,CAAA;AACjB,CAAC,EALW,QAAQ,wBAAR,QAAQ,QAKnB"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.logger = exports.ConsoleLogger = void 0;
|
|
4
|
-
const types_1 = require("../common/types");
|
|
5
|
-
class ConsoleLogger {
|
|
6
|
-
constructor() {
|
|
7
|
-
this.logLevel = types_1.LogLevel.INFO;
|
|
8
|
-
const envLevel = process.env['SQL_PREVIEW_LOG_LEVEL'];
|
|
9
|
-
if (envLevel && Object.values(types_1.LogLevel).includes(envLevel)) {
|
|
10
|
-
this.logLevel = envLevel;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
static getInstance() {
|
|
14
|
-
if (!ConsoleLogger.instance) {
|
|
15
|
-
ConsoleLogger.instance = new ConsoleLogger();
|
|
16
|
-
}
|
|
17
|
-
return ConsoleLogger.instance;
|
|
18
|
-
}
|
|
19
|
-
shouldLog(level) {
|
|
20
|
-
const levels = [types_1.LogLevel.DEBUG, types_1.LogLevel.INFO, types_1.LogLevel.WARN, types_1.LogLevel.ERROR];
|
|
21
|
-
return levels.indexOf(level) >= levels.indexOf(this.logLevel);
|
|
22
|
-
}
|
|
23
|
-
info(message, data) {
|
|
24
|
-
if (this.shouldLog(types_1.LogLevel.INFO)) {
|
|
25
|
-
console.log(`[INFO] ${message}`, data ? JSON.stringify(data) : '');
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
error(message, error) {
|
|
29
|
-
if (this.shouldLog(types_1.LogLevel.ERROR)) {
|
|
30
|
-
console.error(`[ERROR] ${message}`, error);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
warn(message, data) {
|
|
34
|
-
if (this.shouldLog(types_1.LogLevel.WARN)) {
|
|
35
|
-
console.warn(`[WARN] ${message}`, data ? JSON.stringify(data) : '');
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
debug(message, data) {
|
|
39
|
-
if (this.shouldLog(types_1.LogLevel.DEBUG)) {
|
|
40
|
-
console.debug(`[DEBUG] ${message}`, data ? JSON.stringify(data) : '');
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.ConsoleLogger = ConsoleLogger;
|
|
45
|
-
exports.logger = ConsoleLogger.getInstance();
|
|
46
|
-
//# sourceMappingURL=ConsoleLogger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConsoleLogger.js","sourceRoot":"","sources":["../../src/server/ConsoleLogger.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAE3C,MAAa,aAAa;IAIxB;QAFQ,aAAQ,GAAa,gBAAQ,CAAC,IAAI,CAAC;QAGzC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;QACtD,IAAI,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,gBAAQ,CAAC,CAAC,QAAQ,CAAC,QAAoB,CAAC,EAAE,CAAC;YACvE,IAAI,CAAC,QAAQ,GAAG,QAAoB,CAAC;QACvC,CAAC;IACH,CAAC;IAEM,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC;YAC5B,aAAa,CAAC,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;QAC/C,CAAC;QACD,OAAO,aAAa,CAAC,QAAQ,CAAC;IAChC,CAAC;IAEO,SAAS,CAAC,KAAe;QAC/B,MAAM,MAAM,GAAG,CAAC,gBAAQ,CAAC,KAAK,EAAE,gBAAQ,CAAC,IAAI,EAAE,gBAAQ,CAAC,IAAI,EAAE,gBAAQ,CAAC,KAAK,CAAC,CAAC;QAC9E,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChE,CAAC;IAEM,IAAI,CAAC,OAAe,EAAE,IAAc;QACzC,IAAI,IAAI,CAAC,SAAS,CAAC,gBAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAClC,OAAO,CAAC,GAAG,CAAC,UAAU,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,OAAe,EAAE,KAAe;QAC3C,IAAI,IAAI,CAAC,SAAS,CAAC,gBAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACnC,OAAO,CAAC,KAAK,CAAC,WAAW,OAAO,EAAE,EAAE,KAAK,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;IAEM,IAAI,CAAC,OAAe,EAAE,IAAc;QACzC,IAAI,IAAI,CAAC,SAAS,CAAC,gBAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAClC,OAAO,CAAC,IAAI,CAAC,UAAU,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACtE,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,OAAe,EAAE,IAAc;QAC1C,IAAI,IAAI,CAAC,SAAS,CAAC,gBAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACnC,OAAO,CAAC,KAAK,CAAC,WAAW,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;CACF;AA9CD,sCA8CC;AAEY,QAAA,MAAM,GAAG,aAAa,CAAC,WAAW,EAAE,CAAC"}
|