SQLite

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

To connect to SQLite databases in DBCode:

  1. Open the DBCode Extension: Launch Visual Studio Code and open the DBCode extension.
  2. Add a New Connection: Click on the “Add Connection” icon.
  3. 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
  4. Connect: Click save to connect to your SQLite database.
  5. 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

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

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

These extensions are downloaded and managed automatically when selected:

ExtensionVersionDescription
mod_spatialite5.1.0Spatial SQL with geometry, geography, and GIS functions
sqlite-vec0.1.6Vector search and embeddings
sqlite-regex0.2.3Regular expressions via PCRE2
sqlite-js1.1.3User-defined functions in JavaScript
sqlean0.27.2Collection of utilities including crypto, math, text, uuid, and more

Custom Extensions

You can load any SQLite-compatible extension using load_extension() in your post-connection SQL. This is useful for extensions not in the bundled list, or for your own custom extensions.

  1. Open the connection form and expand the Advanced section
  2. Set Post-Connection SQL Source to Inline Script
  3. Add the load_extension() call pointing to your compiled extension file:
SELECT load_extension('/path/to/your/extension');

The extension file must be a compiled shared library (.dylib on macOS, .so on Linux, .dll on Windows) compatible with your platform and architecture.

For more information about SQLite, check out SQLite.