sql-preview 0.5.11
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/LICENSE +21 -0
- package/README.md +106 -0
- package/out/common/errors.js +31 -0
- package/out/common/errors.js.map +1 -0
- package/out/common/types.js +11 -0
- package/out/common/types.js.map +1 -0
- package/out/server/ConsoleLogger.js +46 -0
- package/out/server/ConsoleLogger.js.map +1 -0
- package/out/server/Daemon.js +537 -0
- package/out/server/Daemon.js.map +7 -0
- package/out/server/DaemonMcpServer.js +63 -0
- package/out/server/DaemonMcpServer.js.map +1 -0
- package/out/server/DaemonMcpToolManager.js +433 -0
- package/out/server/DaemonMcpToolManager.js.map +1 -0
- package/out/server/DaemonQueryExecutor.js +96 -0
- package/out/server/DaemonQueryExecutor.js.map +1 -0
- package/out/server/FileConnectionManager.js +108 -0
- package/out/server/FileConnectionManager.js.map +1 -0
- package/out/server/SessionManager.js +103 -0
- package/out/server/SessionManager.js.map +1 -0
- package/out/server/SocketTransport.js +77 -0
- package/out/server/SocketTransport.js.map +1 -0
- package/out/server/standalone.js +90570 -0
- package/package.json +391 -0
package/package.json
ADDED
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sql-preview",
|
|
3
|
+
"displayName": "SQL Preview",
|
|
4
|
+
"description": "Run SQL queries directly from VS Code with tabbed results",
|
|
5
|
+
"version": "0.5.11",
|
|
6
|
+
"publisher": "mehul",
|
|
7
|
+
"icon": "media/icon.png",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/fadnavismehul/sql-preview"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/fadnavismehul/sql-preview#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/fadnavismehul/sql-preview/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"sql",
|
|
18
|
+
"presto",
|
|
19
|
+
"trino",
|
|
20
|
+
"database",
|
|
21
|
+
"query",
|
|
22
|
+
"data",
|
|
23
|
+
"analytics",
|
|
24
|
+
"results",
|
|
25
|
+
"viewer"
|
|
26
|
+
],
|
|
27
|
+
"engines": {
|
|
28
|
+
"vscode": "^1.80.0"
|
|
29
|
+
},
|
|
30
|
+
"categories": [
|
|
31
|
+
"Data Science",
|
|
32
|
+
"Other"
|
|
33
|
+
],
|
|
34
|
+
"activationEvents": [
|
|
35
|
+
"onLanguage:sql"
|
|
36
|
+
],
|
|
37
|
+
"main": "./out/extension.js",
|
|
38
|
+
"bin": {
|
|
39
|
+
"sql-preview-server": "./out/server/standalone.js"
|
|
40
|
+
},
|
|
41
|
+
"files": [
|
|
42
|
+
"out/server",
|
|
43
|
+
"out/common",
|
|
44
|
+
"package.json",
|
|
45
|
+
"README.md",
|
|
46
|
+
"LICENSE"
|
|
47
|
+
],
|
|
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
|
+
"dependencies": {
|
|
372
|
+
"@modelcontextprotocol/sdk": "^1.23.0",
|
|
373
|
+
"@types/json-bigint": "^1.0.4",
|
|
374
|
+
"ajv": "^8.17.1",
|
|
375
|
+
"axios": "^1.8.4",
|
|
376
|
+
"body-parser": "^2.2.1",
|
|
377
|
+
"cors": "^2.8.5",
|
|
378
|
+
"express": "^5.1.0",
|
|
379
|
+
"json-bigint": "^1.0.0",
|
|
380
|
+
"trino-client": "^0.2.6"
|
|
381
|
+
},
|
|
382
|
+
"lint-staged": {
|
|
383
|
+
"*.{ts,js,mjs}": [
|
|
384
|
+
"eslint --fix",
|
|
385
|
+
"prettier --write"
|
|
386
|
+
],
|
|
387
|
+
"*.{json,md}": [
|
|
388
|
+
"prettier --write"
|
|
389
|
+
]
|
|
390
|
+
}
|
|
391
|
+
}
|