🦆 DuckDB for VS Code
OverviewThis extension brings DuckDB directly into VS Code with a focus on creating a productive "DuckDB workspace". Write and execute SQL queries, view results with column statistics, explore database schemas, and manage multiple database connections. How It WorksAll queries execute using the DuckDB Node API embedded in VS Code. By default, queries run against an in-memory database that resets when VS Code closes. You can attach persistent Performance Note: When you execute a query, the extension will create a temporary table which is then used for pagination, sorting, filtering, and exporting. FeaturesSQL Execution
File Integration
Results Table
Column Statistics
Database Explorer
Inline Peek Results
Extensions
Query History
SettingsConfigure in Database Configuration
|
| Property | Type | Description |
|---|---|---|
alias |
string | Database name to use in queries |
type |
"memory" | "file" | "manual" |
Database type |
path |
string | Path to .duckdb file (for file type) |
readOnly |
boolean | Open in read-only mode (default: false) |
attached |
boolean | Auto-attach on startup (default: true) |
sql |
string | Raw ATTACH statement (for manual type) |
duckdb.defaultDatabase
Database to USE after attaching (default: "memory").
duckdb.extensions.autoLoad
Extensions to automatically install and load on startup.
{
"duckdb.extensions.autoLoad": ["httpfs", "parquet", "json", "postgres"]
}
Inline Preview
duckdb.peekResults.livePreview
Enable live preview mode (default: false). When enabled, peeking a statement will auto-refresh results as you type. See the warning above about remote data sources.
duckdb.peekResults.maxRows
Maximum rows in the peek preview (default: 50, range: 5–500).
duckdb.peekResults.debounceMs
Debounce delay in ms for live preview (default: 600, range: 200–5000). Higher values reduce query frequency.
Results Display
duckdb.resultsLocation
Where to open query results (default: "active").
| Value | Description |
|---|---|
beside |
Open in a new editor group beside the SQL file |
active |
Open in the same editor group as the SQL file |
Tip: To open results below your SQL file instead of beside it, set VS Code's workbench.editor.openSideBySideDirection to "down".
duckdb.pageSize
Rows per page in results table (default: 1000, range: 100–10,000).
duckdb.maxCopyRows
Maximum rows for copy/export operations (default: 50000, range: 1,000–1,000,000).
Autocomplete
duckdb.autocomplete.enabled
Enable SQL autocomplete suggestions (default: true).
SQL Formatting
duckdb.format.keywordCase
Keyword casing style (default: "upper").
| Value | Description |
|---|---|
upper |
Uppercase keywords (SELECT, FROM, WHERE) |
lower |
Lowercase keywords (select, from, where) |
preserve |
Preserve original keyword casing |
duckdb.format.indentStyle
Indentation style (default: "standard").
| Value | Description |
|---|---|
standard |
Standard indentation |
tabularLeft |
Tabular style, keywords left-aligned |
tabularRight |
Tabular style, keywords right-aligned |
duckdb.format.logicalOperatorNewline
Where to place logical operators relative to newlines (default: "before").
| Value | Description |
|---|---|
before |
Place AND/OR before the newline |
after |
Place AND/OR after the newline |
Query History
duckdb.history.persist
Save query history to .vscode/duckdb-history.db (default: false).
duckdb.history.maxEntries
Maximum history entries to keep (default: 1000).
Commands
| Command | Keybinding | Description |
|---|---|---|
| DuckDB: Execute Query | Cmd+Enter |
Run all SQL in active editor |
| DuckDB: Run Statement | — | Run a single statement (via CodeLens) |
| DuckDB: Run at Cursor | Ctrl+Shift+Enter |
Run the statement under the cursor |
| DuckDB: Select Database | — | Switch active database |
| DuckDB: Manage Extensions | — | Install/remove extensions |
| DuckDB: Query File | — | Query a data file (right-click) |
| DuckDB: Summarize File | — | Profile a data file |
| DuckDB: Copy Query | — | Copy SELECT statement for file |
| Go to Source File | — | Navigate from results to source SQL |
Releasing
Releases are automated via GitHub Actions. Pushing a version tag triggers the CI/CD pipeline which builds, packages, and publishes the extension.
Steps
Bump the version in
package.json:"version": "0.0.15"Commit the version bump:
git add package.json git commit -m "version bump"Tag and push:
git tag v0.0.15 git push origin main --tags
What happens
The v* tag triggers the CI/CD workflow:
- Build — Lint, compile, and run tests on macOS, Ubuntu, and Windows
- Package — Create platform-specific
.vsixfiles fordarwin-arm64,darwin-x64,linux-x64, andwin32-x64 - Publish — Upload to both VS Code Marketplace and Open VSX
Secrets
The publish steps require these repository secrets:
VSCE_PAT— VS Code Marketplace Personal Access TokenOVSX_PAT— Open VSX Registry Personal Access Token
Requirements
- VS Code 1.85.0 or later
- macOS, Linux, or Windows
License
MIT
Not affiliated with DuckDB Labs. DuckDB is a trademark of DuckDB Labs.


