sqlite-expert
What it does
This skill guides using SQLite as an embedded single-file database, including performance settings, transactions and full-text search. It is for developers building small apps, mobile apps, devices or local caches.
When to use it
- ✓When you are building a small app or device that stores data in one SQLite file.
- ✓When SQLite throws busy errors and needs better concurrent access settings.
- ✓When you need full-text search inside a SQLite database.
Skill link
https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/sqlite-expert/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Set up SQLite for my small note-taking app so reads and writes work together smoothly, and add search across note titles and bodies.”
5 new skills a week. 1 minute to read.
How it works
The skill recommends write-ahead logging, a busy timeout, short explicit transactions, sensible indexes and the FTS5 extension for full-text search.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
SQLite Expert
A database specialist with deep expertise in SQLite internals, performance tuning, and embedded database patterns. This skill provides guidance for using SQLite effectively in applications ranging from mobile apps and IoT devices to server-side caching layers and analytical workloads, leveraging its advanced features well beyond simple key-value storage.
Key Principles
- Enable WAL mode (PRAGMA journal_mode=WAL) for concurrent read/write access; it allows readers to proceed without blocking writers and vice versa
- Use PRAGMA busy_timeout to set a reasonable wait duration (e.g., 5000ms) instead of receiving SQLITE_BUSY errors immediately on contention
- Design schemas with appropriate indexes from the start; SQLite's query planner relies heavily on index availability for efficient execution plans
- Keep transactions short and explicit; wrap related writes in BEGIN/COMMIT to ensure atomicity and reduce fsync overhead
- Understand that SQLite is serverless and single-file; its strength is simplicity and reliability, not high-concurrency multi-writer workloads
Techniques
- Set performance PRAGMAs at connection open: journal_mode=WAL, synchronous=NORMAL, cache_size=-64000 (64MB), mmap_size=268435456, temp_store=MEMORY
- Use FTS5 for full-text search: CREATE VIRTUAL TABLE docs USING fts5(title, body) with MATCH queries and bm25() ranking
- Query JSON data with the JSON1 extension: json_extract(), json_each(), json_group_array() for document-style data stored in TEXT columns
- Write recursive CTEs (WITH RECURSIVE) for tree traversal, graph walking, and generating series of values
- Use window functions (ROW_NUMBER, LAG, LEAD, SUM OVER) for running totals, rankings, and time-series analysis without self-joins
- Create covering indexes that include all columns needed by a query to enable index-only scans (verified with EXPLAIN QUERY PLAN showing COVERING INDEX)
- Implement UPSERT with INSERT ... ON CONFLICT (column) DO UPDATE SET for atomic insert-or-update operations
Common Patterns
- Multi-database Access: Use ATTACH DATABASE to query across multiple SQLite files in a single connection, joining tables from different databases
- Application-defined Functions: Register custom scalar or aggregate functions in your host language for domain-specific computations inside SQL queries
- Incremental Vacuum: Use PRAGMA auto_vacuum=INCREMENTAL with periodic PRAGMA incremental_vacuum to reclaim space without a full VACUUM lock
- Schema Migration: Use PRAGMA user_version to track schema version and apply migration scripts sequentially on application startup
Pitfalls to Avoid
- Do not open multiple connections with different PRAGMA settings; WAL mode and other PRAGMAs should be set consistently on every connection
- Do not use SQLite for high-concurrency write workloads with dozens of simultaneous writers; consider PostgreSQL or another client-server database instead
- Do not store large BLOBs (over 1MB) inline; SQLite performs better when large objects are stored as external files with paths referenced in the database
- Do not skip EXPLAIN QUERY PLAN during development; without it, slow full-table scans go unnoticed until production load reveals them
FAQ
What is WAL mode?
It is a journal mode that lets readers continue while a writer works, which helps with concurrent access.
Is SQLite good for many writers at once?
The skill says SQLite is strongest for simple, reliable single-file storage, not high-concurrency multi-writer workloads.
What does a busy timeout do?
It makes SQLite wait a set time for a lock instead of failing immediately when another write is in progress.
Details
Original description by the author
SQLite expert for WAL mode, query optimization, embedded patterns, and advanced features
repo: RightNow-AI/openfang
Popularity
- GitHub stars
- 18k
- Ranking position
- #10714
- License
- Apache-2.0
- Updated
- 7/2/2026
Comments
- …
More skills from this repository
browser-automation
18kTeaches your agent to control a web browser with Playwright, using CSS selectors to find buttons, forms and links.
clip-hand-skill
18kHelps your agent make video clips: download a video, transcribe its speech, create subtitle files and cut clips with ffmpeg.
collector-hand-skill
18kHelps your agent gather public information on a topic or company, pull out key entities, track changes and gauge sentiment.
infisical-sync-skill
18kHelps your agent read and update secrets in an Infisical vault through its API, with login steps and clear error handling.
Similar skills
discrawl
394kLets your agent search and summarize a saved local archive of Discord messages, check how fresh it is, and read direct messages.
clickhouse-io
280kHelps your agent optimize queries and schemas in ClickHouse databases. It applies best practices for high-performance analytical workloads. Use when analytical queries are too slow.
scientific-db-pubmed-database
280kHelps your agent search for scientific articles in the biomedical field. It's useful for research needing specific medical information.