Registry / devops / sql-preview

sql-preview

JSON →
library0.6.4jsnpmunverified

SQL Preview is a VS Code extension and standalone MCP database server that provides a local-first SQL workspace for humans and AI agents. Version 0.6.4 supports PostgreSQL, MySQL, SQLite, DuckDB, Trino/Presto, Snowflake, BigQuery, and SQL Server with a connection manager, AG Grid-powered result grid, daemon-backed execution, and an MCP server for Claude Desktop, Cursor, etc. Released under MIT license, it differentiates by offering governed read-only database access through MCP tools while keeping credentials local and telemetry opt-in. Updates are frequent (multiple releases per month).

npm install sql-preview
INSTALL
IMPORT
SIG · SQL-PREVIEW
S
sql-preview
devopsjavascriptv0.6.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const sqlPreview = require('sql-preview');
This is a VS Code extension; there is no programmatic API import. Use 'extension' activation via VS Code.

Shows how to programmatically start the SQL Preview MCP server for custom integrations.

// No JavaScript code needed; install extension from marketplace. // To use MCP server programmatically: const { MCPServer } = require('sql-preview/daemon'); const server = new MCPServer({ dbType: 'sqlite', connection: { path: './test.db' } }); await server.start(); // Then process requests from MCP clients.
Debug
Known issues
gotchaExtension may silently fail if VS Code Secret Storage is unavailable or password is missing for a connection profile.
fix
Ensure passwords are stored via the 'Set Password' command in the SQL Preview panel.
affects: >=0.1.0
gotchaLegacy settings (sqlPreview.host, etc.) were deprecated; migration is required for version 0.4+.
fix
Run 'SQL Preview: Migrate Legacy Settings' from Command Palette and use the connection manager UI.
affects: >=0.4.0
deprecatedThe bundled Trino/Presto driver uses an older connector; users are advised to switch to the native Trino connector if available.
fix
Update to version 0.6.0+ or follow migration guide for Trino connector configuration.
affects: <0.6.0
gotchaResult grid may display incorrectly if VS Code zoom level is not 100% due to AG Grid pixel-snapping.
fix
Reset VS Code zoom to default via View > Appearance > Zoom Out.
affects: >=0.5.0
gotchaSafe mode (read-only) is enabled by default for MCP server; users must explicitly disable safety to allow write operations if needed.
fix
Set `safe: false` in MCP configuration or pass `--unsafe` flag to daemon CLI.
affects: >=0.3.0
Errors
Common errors & fixes
Could not find connector for database type 'postgresql'
Using incorrect connector name; PostgreSQL expects 'postgres', not 'postgresql'.
fix
Change connector type from 'postgresql' to 'postgres' in the connection profile.
Failed to connect: missing driver for BigQuery
BigQuery driver is lazy-loaded and not bundled; requires manual installation.
fix
Install the `@google-cloud/bigquery` package locally or add it to your environment's PATH.
Password is empty or not set
Connection profile has no password stored in Secret Storage.
fix
Use the 'Set Password' action in SQL Preview panel for the profile.
Legacy settings detected. Please migrate.
Extension upgraded from old settings format (pre-v0.4) and refuses to use them.
fix
Run 'SQL Preview: Migrate Legacy Settings' from Command Palette.
MCP server refused connection: safe mode enabled
MCP client attempted a write operation on a read-only server.
fix
Disable safe mode via configuration: `safe: false` or `--unsafe` daemon flag.
Upgrade
Version history
0.6.4latest on npm
Audit
Dependencies
vscoderequiredExtension API for VS Code integration; engines field requires ^1.80.0
Agent activity
13 hits · last 30 days
node
10
Meta
2
OpenAI (training)
1
Resources
sql-preview — npm install sql-preview · libregistry