This extension allows you to edit SQLite 3 files without having to write SQL queries.
IMPORTANT: This extension requires Python >=3.6 compiled with SQLite >=3.37.0 (fully supported) or >=3.8.8 (partially supported). The extension will notify you if the requirements are not met.
Table of Contents
Spreadsheet GUI for Browsing and Editing Data
This extension offers several features for editing SQLite databases intuitively:
These features are not present in other VSCode extensions for SQLite, such as alexcvzz/SQLite and SQLite Viewer.
Advanced Query Editor
Although this extension was initially created to fill the need for an extension that could intuitively edit SQLite databases using a GUI, it also comes with an advanced query editor that supports auto-completion, syntax highlighting, hover information, signature help, and syntax validation.
TODO: The image above is from a version before the syntax validator was added.
To access the query editor, click the "Custom Query" button.
The line comment at the first line of the query editor indicates which database the editor is connected to, and should not be deleted, or the query editor will be disconnected from the database. The comment serves the purpose of enabling the user to save the content of the query editor as a file and reuse it later.
There are two ways to execute statements in the query editor:
The extension checks the database's mtime every second to automatically reload the table, which may result in a slight delay between the execution of a statement and the updates to the table.
The extension finds syntax errors by preparing (or compiling) each statement in the editor and catching compilation errors. However, some PRAGMAs do their work when the statement is prepared , so we do not check them for syntax errors.
 "Some PRAGMA statements do ..." in https://www.sqlite.org/lang_explain.html#explain_operates_at_run_time_not_at_prepare_time
You can format queries by selecting "Format Document" in the command palette or by pressing Shift+Alt+F.
This feature employs sql-formatter to format queries.
You can adjust formatting options with the configurations under
Common Table Expression (CTE) Support
To make it easier to create a complex query involving CTEs, the extension adds buttons that enable you to display the output of each CTE.
Sometimes, you may want to write a SQL query for use in source code with code completions enabled. However, this extension requires a database connection to enable its IDE features. In such cases, you can connect to an in-memory database using
You can switch between tables by clicking a table name in either the editor or the explorer.
Filtering and Sorting Data
This extension also includes a find widget that enables you to filter records using regex, whole word, and case-sensitivity switches, making data searching faster than using the query editor to write WHERE clauses.
To sort records by a specific column, simply click on the column name. You can also sort the table from the context menu on the column name.
UPDATE and DELETE statements support multi-selection. To select multiple cells, you can either drag over the cells, click a cell with the alt key pressed, or press the Shift + Arrow keys while a cell is selected.
Table Schema Viewer
By clicking the "Schema" button located next to the table name, you can view the schema of the table, as well as its indexes and triggers.
When you open a database from the source control view, you will see a side-by-side comparison of two versions of the database.
To display the differences between the two versions, click the "Compare with Local File" button. Depending on the size of the database, it may take several seconds or minutes for the differences to appear. If locking the databases is a problem for your use-case, you should avoid using this feature.
Full 64-bit integer support
By clicking the "Other Tools..." button, you can access various features, including CSV, JSON, and SQL imports and exports. These features require you to install the sqlite-utils package.
This extension recognizes
Links to Tables or Queries
You can create links to specific tables or queries using query strings. Note that VSCode's automatic linking, which is enabled by the "editor.links" configuration, may drop query parameters in relative links.
Creating a Database
To create a database, simply create a file with a supported file extension, such as .db, .sqlite, or .sqlite3. The extension will automatically initialize the file as a database if it is empty and has one of the supported extensions.
GUI Editors for CREATE TABLE, ALTER TABLE, CREATE INDEX, CREATE TABLE, DROP TABLE, and INSERT
To access the GUI editors for these statements, click the name of the current statement and choose the desired option from the context menu.
Displaying and Jumping to the Definition of Foreign Keys
You can display and jump to the definition of foreign keys by hovering your mouse over them and using context menus.
You can resize columns by dragging the right edge of the column header, or by using the "Autofit Column Width" button to adjust the width according to the content.
Here is a comparison table for related projects, as of February 2023.
VSCode Extensions | Name | Cross-platform? | Free? | Easy to use (for me)? | Supports many DBMS? | Has a query editor? | Supports in-place editing? | Paging Method *2 | Other comments | |--|--|--|--|--|--|--|--|--| | VSCode + SQLite3 Editor (This project) | ✓ | ✓ | ✓ | x | ✓ | ✓ | ✓ scroll bar | supports syntax validation | | VSCode + SQLite | ✓ | ✓ | x | x | ✓ | x | x pagination | | | VSCode + SQLTools | ✓ | ✓ | x | ✓ | ✓ | x | x pagination | | | VSCode + MySQL | ✓ | x; not all features are free | x | ✓ | - | - | - | | | VSCode + SQLite Viewer | ✓ | ✓ | ✓ | x | x | x | ✓ scroll bar | |
Standalone Applications | Name | Cross-platform? | Free? | Easy to use (for me)? | Supports many DBMS? | Has a query editor? | Supports in-place editing? | Paging Method *2 | Other comments | |--|--|--|--|--|--|--|--|--| | VSCode + SQLite3 Editor (This project) | ✓ | ✓ | ✓ | x | ✓ | ✓ | ✓ scroll bar | supports syntax validation | | DbGate | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | x infinite scroll | feature rich | | DBeaver | ✓ | ✓ | x; too many buttons | ✓ | ✓ | ✓ | x infinite scroll | feature rich | | Antares SQL Client | ✓ | ✓ | ✓ | ✓ | x | ✓ | x pagination | | | SQLPad | ✓ | ✓ | - | - | - | - | - | maintenance mode | | Beekeeper Studio | ✓ | x | - | ✓ | ✓ | ✓ | - | | | DB Browser for SQLite | ✓ | ✓ | x; too many buttons | x | ✓ | ✓ | x pagination | | | SQLiteStudio | ✓ | ✓ | x; too many buttons | x | - | - | - | | | SQLiteFlow | x; Mac only | ✓ | - | x | - | - | - | | | sqlectron | ✓ | ✓ | ✓ | ✓ | x | - | | | little-brother/sqlite-gui | x; Windows only | ✓ | - | x | - | - | - | | | SQLPro | x; Mac only | x | - | ✓ | - | - | - | | | SQLiteExpert | x; Windows only | x | - | x | ✓ | ✓ | - | | | Native SQLite Manager | x; Mac only | - | - | x | - | - | - | | | Navicat | ✓ | x | - | ✓ | ✓ | - | - | |
This extension automatically selects a Python interpreter in the system's PATH that has the highest bundled database version. However, if an unexpected version of Python is selected or if you want to use a Python that is not in the PATH, you can use this setting.
The binary specified in this configuration must be either CPython (the standard version available from python.org) or PyPy. The extension does not accept other types of Python or a path to a virtual environment.
Some advanced features require building a helper program to access the SQLite C/C++ interface. This setting is used to set the location of the built program for the extension.
By default, this extension saves the last 500 SQL queries in ExtensionContext.globalState and you can view it using
This configuration specifies the SQL statements that are executed immediately after connecting to a database.
The keys are case-sensitive regular expressions used to match the file URI (e.g.
This configuration is similar to the "sqlite.setupDatabase" configuration in alexcvzz/sqlite but differs in that it uses regular expressions for path comparison.
As this extension uses Python to connect to databases, commands such as
For example, to execute
This configuration allows you to view which setup queries were used. If enabled, the extension displays the URI matched against the regex patterns in connectionSetupQueries and the result of the match for each pattern when an editor is opened.
This configuration loads run-time loadable extensions immediately after connecting to a database, using the
Most run-time loadable extensions can be loaded with
The keys are case-sensitive regular expressions used to match the file URI, and the values are the list of runtime-loadable extensions to be loaded. In case multiple patterns match the same URI, only the first item will be used. The runtime-loadable extensions are loaded before executing the setup queries specified in
For example, to load the
The drop-down in the top left corner, used to select a table, has performance problems when the number of tables is large (> 1000). To address this issue, this extension displays a notification to recommend enabling this configuration when a large database is opened.
When this configuration set to true, mouse clicks on a table name in the top left corner will open a VSCode's quick pick widget instead of the drop-down menu. This configuration provides faster rendering, but it may be less intuitive to use.
Monitoring and Reporting
This extension displays a "Send error report" button on error notifications. When clicked, it sends the error message with sensitive information removed to the extension's author using Microsoft/vscode-extension-telemetry, or opens a GitHub issue, depending on the user's telemetry settings. If vscode-extension-telemetry is used, the system information (i.e. the "common properties" of Microsoft/vscode-extension-telemetry) will also be included.
Keep in mind that the bugs may not be fixed if the reports do not include enough information or the developer is busy, but your help in reporting errors is greatly appreciated.
This extension collects anonymous telemetry data using Microsoft/vscode-extension-telemetry.
The purpose of this telemetry is to:
The following is the list of data collected, and no sensitive or personal information will be collected or transmitted:
The data collected is encrypted and will be deleted after 90 days, which is the default setting in Microsoft Azure Monitor.
The data collected will only be used to improve the extension and will not be shared with any third parties.
VSCode provides the "telemetry.enableTelemetry" configuration option to control telemetry, and this extension, along with any other extensions using Microsoft/vscode-extension-telemetry, follows this setting.
Please note that the telemetry data collected by this extension may change in future releases.