sqliteUse SQLite correctly with proper concurrency, pragmas, and type handling.
Install via ClawdBot CLI:
clawdbot install ivangdavila/sqliteRequires:
PRAGMA journal_mode=WAL—allows reads during writes, huge improvementPRAGMA busy_timeout=5000—waits 5s before SQLITE_BUSY instead of failing immediately-wal and -shm files—don't forget to copy them with main databaseBEGIN IMMEDIATE to grab write lock early—prevents deadlocks in read-then-write patternsPRAGMA foreign_keys=ON required per connection—not persisted in databasePRAGMA foreign_keys returns 0 or 1STRICT tables enforce types—but only SQLite 3.37+ (2021)ALTER TABLE very limited—can add column, rename table/column; that's mostly itALTER TABLE ADD COLUMN can't have PRIMARY KEY, UNIQUE, or NOT NULL without defaultPRAGMA optimize before closing long-running connections—updates query planner statsPRAGMA cache_size=-64000 for 64MB cache—negative = KB; default very smallPRAGMA synchronous=NORMAL with WAL—good balance of safety and speedPRAGMA temp_store=MEMORY for temp tables in RAM—faster sorts and temp resultsVACUUM rewrites entire database, reclaims spaceVACUUM needs 2x disk space temporarily—ensure enough roomPRAGMA auto_vacuum=INCREMENTAL with PRAGMA incremental_vacuum—partial reclaim without full rewrite.backup command in sqlite3—or sqlite3_backup_* API-wal and -shm must be copied atomically with main fileVACUUM INTO 'backup.db' creates standalone copy (3.27+)CREATE INDEX ... WHERE conditionCREATE INDEX ON t(lower(name))EXPLAIN QUERY PLAN shows index usage—simpler than PostgreSQL EXPLAINBEGIN; INSERT...; INSERT...; COMMIT—10-100x fasterBEGIN EXCLUSIVE for exclusive lock—blocks all other connectionsSAVEPOINT name / RELEASE name / ROLLBACK TO nameVACUUM can change ROWIDs; use explicit INTEGER PRIMARY KEY':memory:'—each connection gets different database; use file::memory:?cache=shared for sharedGenerated Mar 1, 2026
Ideal for mobile applications that require offline data access, such as note-taking apps or fitness trackers. SQLite's lightweight nature and file-based storage allow efficient local data management without server dependency, with WAL mode ensuring smooth read-write operations on user devices.
Used in IoT devices or embedded systems to store configuration settings and sensor logs locally. SQLite's minimal footprint and reliability in low-resource environments make it suitable, though concurrency limitations require careful design for single-writer scenarios.
Perfect for desktop software like accounting tools or media libraries that handle moderate user data. It supports transactions for data integrity and indexing for performance, but developers must implement proper backup procedures to avoid corruption during file copies.
Enables rapid prototyping for web or app backends during development phases, allowing quick schema changes and testing without complex setup. However, its concurrency limits mean it should be replaced with systems like PostgreSQL before scaling to production with multiple users.
Offers a free app with basic features using SQLite for local storage, then charges for premium features like cloud sync or advanced analytics. Revenue comes from in-app purchases or subscriptions, leveraging SQLite's efficiency to keep core functionality lightweight and responsive.
Sells licensed software for industrial or medical devices that use SQLite to manage operational data and logs. Revenue is generated through one-time license fees or annual maintenance contracts, with SQLite providing a stable, low-maintenance database solution.
Provides a web-based service where SQLite is used as a local cache on client machines to improve performance and enable offline functionality. Revenue streams include monthly subscriptions, with SQLite reducing server load and enhancing user experience during connectivity issues.
đź’¬ Integration Tip
Always enable WAL mode and set busy_timeout for concurrency handling, and use transactions to batch inserts for performance gains.
Use the @steipete/oracle CLI to bundle a prompt plus the right files and get a second-model review (API or browser) for debugging, refactors, design checks, or cross-validation.
Manage Things 3 via the `things` CLI on macOS (add/update projects+todos via URL scheme; read/search/list from the local Things database). Use when a user asks Clawdbot to add a task to Things, list inbox/today/upcoming, search tasks, or inspect projects/areas/tags.
Local search/indexing CLI (BM25 + vectors + rerank) with MCP mode.
Use when designing database schemas, writing migrations, optimizing SQL queries, fixing N+1 problems, creating indexes, setting up PostgreSQL, configuring EF Core, implementing caching, partitioning tables, or any database performance question.
Connect to Supabase for database operations, vector search, and storage. Use for storing data, running SQL queries, similarity search with pgvector, and managing tables. Triggers on requests involving databases, vector stores, embeddings, or Supabase specifically.
Query, design, migrate, and optimize SQL databases. Use when working with SQLite, PostgreSQL, or MySQL — schema design, writing queries, creating migrations, indexing, backup/restore, and debugging slow queries. No ORMs required.