DuckDB SQL Tools
DuckDB SQL Tools Preview extension adds basic DuckDB SQL support to VS Code IDE. This DuckDB VS Code extension provides DuckDB connections and main database schema tree view, SQL query API and user interfaces for the popular SQL Tools extension, SQL query editor, SQL language server, and data processing tools.
DuckDB is an in-process SQL OLAP database management system that uses vectorized data engine for optimized analytics and parallel query processing with extensive SQL support and direct
DuckDB SQL Tools Preview extension v1.4.0 adds the following basic DuckDB SQL capabilities to VS Code IDE for working with DuckDB instances:
See SQL Tools documentation for a comprehensive list of SQL Tools extension features contributed to VS Code IDE.
Alternatively, you can install this extension directly in VS Code IDE from Extensions tab (
Users of VS Codium and other VS Code based IDEs can install DuckDB SQL Tools Preview extension using
Download and install Node.js from the official Node.js downloads page. Node.js is used as a local web server to host local data and DuckDB files. Node.js will install npm tool we use to install
We use Node.js DuckDB library instead of the limited DuckDB WASM browser JS library other similar DuckDB data tools use to enable faster data imports and loading via multi-threaded
VS Code SQL and Pro Data Tools
The following sections provide a summary of the popular SQL Tools VS Code extension, database drivers, our public Random Fractals Inc. Data Tools extensions, and new premium Pro Data Tools available to our Pro sponsors on GitHub.
SQL Tools VS Code extension provides connections to many commonly used databases, and includes database connection management tree view with database schema info and objects display, basic table viewer for SQL query results display, and SQL language server for editing SQL in VS Code with SQL syntax highlighting and auto-completion.
SQL Tools Drivers
Random Fractals Data Tools
Random Fractals Inc. Data Tools 🛠️ is a collection of public data visualization extensions, data viewers, VS Code Notebook renderers, and code snippets for devs and data scientists using VS Code IDE, published under our Random Fractals Inc. ☂️ org.
Pro Data Tools
Pro Data Tools is our new Premium set of SQL and PRQL Code Lenses and Data Viewers created for our monthly Pro sponsors on GitHub to enhance SQL development and SQL statements execution runtime workflow in VS Code IDE, connected to the different database management systems via SQL Tools extension, database plugins, and SQL Tools drivers.
DuckDB Pro Tools
Pro Data Tools include DuckDB Pro Tools extension that adds advanced DuckDB connection features and support to VSCode IDE, and provides database schemas display, DuckDB extensions and settings views, information schema and catalog views, SQL query API and user interfaces integrated with the popular SQL Tools extension, SQL query editor, SQL language server, and VS Code data processing tools.
DuckDB Pro Tools View Commands
SQLite Pro Tools
Pro Data Tools VS Code extensions also include SQLite Pro Tools. SQLite Pro Tools provide over a dozen of common SQLite database shortcut Commands, display table column data type and primary key indicators, SQLite database Indexes, Modules, Configuration Settings and Functions.
PRQL Pro Tools
Our Pro sponsors on github also get access to the premium PRQL Pro Tools VS Code extension. The initial private beta release of PRQL Pro Tools comes with custom PRQL Code Lens SQL Tools plugin that allows you to run PRQL queries for the supported PRQL target SQL dialects directly using any of the supported SQL Tools extension drivers for the different database management systems.
Markdown SQL Pro Tools
The provided SQL Code Lenses include top-level SQL and markdown document
Our SQL Code Lenses integrate with the popular SQL Tools Connections manager, supported SQL Tools drivers, and query results viewer to execute SQL directly on any of the supported SQL Tools database management systems and view results.
Markdodown SQL Pro Tools extension is available under the new Markdown Sql Pro Tools monthly sponsor subscription on GitHub and also includes access to the DuckDB Pro SQL Tools plugin and PRQL Code Lens extension from our Premium Pro Data Tools extensions pack.
Data Notebook Pro Tools
Data Notebook Pro extension integrates SQL Tools connections, supported database management systems, our Data Table Renderers and VS Code Jupyter Notebook user interface to view and run SQL queries from
Data Notebook SQL Query
Simple example of running SQL query with the new Data Notebook Pro Tools extension:
Data Notebook Output Rendering
Using different Data Table Renderers in the Data Notebook created from SQL document with multiple SQL queries:
DuckDB egnine also provides a number of Extensions you can install and load to work with remote
You can check the list of core and installed DuckDB extensions by running the following SQL query on an open database connection:
DuckDB SQL Tools VS Code extension installs and loads HTTPFS DuckDB extension by default for all the open database connections. You can add other DuckDB Extensions to the active DuckDB connection by running
Example of loading trimmed down Chicago crimes data reported in 2022 into an in-memory DuckDB instance from a
This example uses implicitly loaded DuckDB HTTPFS extension to query reported Chicago crimes parquet data file with over 210K recorded crime reports, creates a
DuckDB SQLite Scanner
Run the following SQL statements to add SQLite Scanner DuckDB extension to an open database connection:
With the loaded SQLite Scanner DuckDB extension you can attach SQLite database file to a DuckDB database instance. Attached SQLite database tables will show up as views in DuckDB instance.
Run the following SQL
DuckDB File References
Note: DuckDB SQL Tools extension uses DuckDB NodeJS Client API. In order to work with local data files, you need to specify full path to your local database or data files in SQL statements that reference local file paths.
Future versions of this extension might simplify local file path references by deducing absolute file path from the local DuckDB file connection string or open VS Code project workspace folder path, and replacing relative database or data file references with the corresponding absolute path in an open VS Code project workspace.
Also, note in the
DuckDB SQL Tools extension documentation repository contains sample /data folder with
The cninook/duckdb demo data folder also has sample SQL query files you can try running on this well-known sample database with our VS Code extension.
Due to the limited time and minimal development effort invested into building this Free Trial DuckDB SQL Tools extension, our Preview version of this extension comes with the following known limitations and supported usage scenarios.
DuckDB SQL Tools Preview v1.4.0 release of this extension supports only local database instances created with DuckDB v0.9.2 engine. Database instances and files created with older minor versions of DuckDB are not supported as they use different compression and storage formats and the structure of
Use DuckDB CLI to export data from the older database file versions and create new
You can use prior
The Premium DuckDB Pro Tools extension version, available to our Pro sponsors on GitHub, supports DuckDB v0.8.1 files with many advanced SQL Tools features, and will be updated to support the latest DuckDB v0.9.x storage format and features soon.
DuckDB SQL Tools Preview extension opens
The Premium DuckDB Pro Tools extension version, available to our Pro sponsors on GitHub, supports opening
You can experiment with writable
DuckDB SQL Tools Preview extension lets you create in-memory database instances by specifying
The following SQL Tools Settings were used while creating and testing this DuckDB SQL Tools extension and are recommended for working with DuckDB instances efficiently. We suggest you set these preferences in your User Settings in VS Code by navigating to
Please use our public DuckDB SQL Tools GitHub Discussions portal to submit your feedback, share examples of how you are using DuckDB SQL Tools VS Code extension, or request new trivial and premium features. Our goal with this extension and DuckDB Pro Tools is to make DuckDB more accessible and easier to use in VS Code IDE.
Become a Fan or a Pro Sponsor of our work on this and other Random Fractals, Inc. code and data viz extensions if you find them useful, educational, or enhancing your daily dev workflows and exploratory data analysis experience in VS Code IDE.