Databases
SQLite Database Management in VS Code
DBCode is a SQLite extension for VS Code: open local database files, browse tables and data, run SQL with schema-aware autocomplete, and edit rows visually, all inside your editor with no server to set up. Install DBCode to get started, or see how it compares to standalone database tools.
Overview
Section titled “Overview”SQLite is a self-contained, serverless relational database management system (RDBMS) that provides a lightweight and efficient solution for local data storage. Key advantages include:
- Zero configuration: No server setup or administration required
- Portable: The entire database is stored in a single cross-platform file
- Embedded: Can be directly integrated into applications
- Reliable: ACID-compliant with atomic transactions
- Small footprint: Less than 600KB fully configured
SQLite is ideal for development, testing, embedded systems, and applications that need local data storage without the overhead of a client-server database.
Connecting
Section titled “Connecting”To connect to SQLite databases in DBCode:
- Open the DBCode Extension: Launch Visual Studio Code and open the DBCode extension.
- Add a New Connection: Click on the “Add Connection” icon.
- Complete connection form: Select SQLite as the database type and:
- Browse to select your .db file or create a new one
- No authentication required - SQLite uses file system permissions
- Connect: Click save to connect to your SQLite database.
- Start Exploring: Begin working with your tables, views, and data.
For detailed instructions on connecting to SQLite, refer to the Connect article.
SQLite Features in DBCode
Section titled “SQLite Features in DBCode”DBCode enhances your SQLite development experience with:
- Schema visualization: View your database structure with entity relationship diagrams
- Query history: Track and reuse previous queries
- Export capabilities: Save query results in various formats
- Syntax highlighting: SQL syntax specifically optimized for SQLite dialect
- Table data editing: Modify your data directly within Visual Studio Code
By using SQLite with DBCode, you can quickly develop and test database-driven applications within your familiar VS Code environment.
Extensions
Section titled “Extensions”DBCode supports loading SQLite extensions to add functionality beyond what SQLite provides natively. Extensions are available in the Advanced section of the connection form.
Bundled Extensions
Section titled “Bundled Extensions”These extensions are downloaded and managed automatically when selected:
| Extension | Version | Description |
|---|---|---|
| mod_spatialite | 5.1.0 | Spatial SQL with geometry, geography, and GIS functions |
| sqlite-vec | 0.1.6 | Vector search and embeddings |
| sqlite-regex | 0.2.3 | Regular expressions via PCRE2 |
| sqlite-js | 1.1.3 | User-defined functions in JavaScript |
| sqlean | 0.27.2 | Collection of utilities including crypto, math, text, uuid, and more |
Custom Extensions
Section titled “Custom Extensions”You can load any SQLite-compatible extension from disk, which is useful for extensions not in the bundled list, or for your own builds.
- Open the connection form and expand the Advanced section
- Enter the full path to your compiled extension file in Custom Extensions
- Reconnect
To load more than one, separate the paths with commas:
/opt/sqlite/spellfix.dylib, /opt/sqlite/uuid.dylibThe extension file must be a compiled shared library (.dylib on macOS, .so on Linux, .dll on Windows) compatible with your platform and architecture. Custom extensions load on connect, at the same point as the bundled ones, so virtual tables that depend on them resolve when the schema is read.
For more information about SQLite, check out SQLite.