Provides commands and patterns for embedding SQLite databases in applications.
Install
mkdir -p .claude/skills/sqlite-ssrjkk && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/19170" && unzip -o skill.zip -d .claude/skills/sqlite-ssrjkk && rm skill.zipInstalls to .claude/skills/sqlite-ssrjkk
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Embeds SQLite databases in applications with zero configuration and single-file storage. Use for local data persistence.Key capabilities
- →Create SQLite database files
- →Define database schemas using SQL
- →Insert data into tables
- →Query data from tables
- →List tables in a database
- →Show schema for a specific table
How it works
The skill uses the `sqlite3` command-line tool to create and interact with SQLite databases, allowing for schema definition, data insertion, and querying.
Inputs & outputs
When to use sqlite
- →Embed SQLite in app
- →Define database schema
- →Query local data
About this skill
SQLite
Embedded relational storage with SQLite.
Quick Start
sqlite3 app.db
CREATE TABLE users (id INTEGER PRIMARY KEY, email TEXT UNIQUE);
INSERT INTO users (email) VALUES ('[email protected]');
When to Use
- Local/desktop/mobile storage
- Single-machine apps with small data
- Prototypes and embedded tools
- Read-heavy offline datasets
Best Practices
Schema
- Use INTEGER PRIMARY KEY or explicit rowid
- Prefer TEXT for dates (ISO) or REAL for timestamps
- Add UNIQUE and CHECK constraints
- Use
STRICTtables (SQLite 3.37+) for typed data
Concurrency
- Enable WAL mode for concurrent readers
- Use short write transactions
- Set
busy_timeoutto avoid SQLITE_BUSY - Avoid long-running read transactions
Performance
- Index columns used in WHERE/JOIN
- Use
PRAGMAto tune (cache_size, mmap) - Batch writes in transactions
VACUUMperiodically to reclaim space
Durability
- Choose journal mode by need (WAL vs DELETE)
- Set
synchronous=NORMALin WAL for speed - Back up via
.backupor VACUUM INTO - Test on the target filesystem
Dependencies
sqlite3 # CLI
# Python: sqlite3 stdlib
Examples
-- WAL and busy timeout
PRAGMA journal_mode=WAL;
PRAGMA busy_timeout=5000;
-- Schema with constraints
CREATE TABLE users (
id INTEGER PRIMARY KEY,
email TEXT NOT NULL UNIQUE,
role TEXT NOT NULL DEFAULT 'member'
CHECK (role IN ('member','admin'))
);
CREATE INDEX idx_users_role ON users(role);
# Python usage with transactions
import sqlite3
conn = sqlite3.connect("app.db")
conn.execute("PRAGMA journal_mode=WAL")
with conn:
conn.execute("INSERT INTO users (email, role) VALUES (?, ?)", ("[email protected]", "admin"))
for row in conn.execute("SELECT * FROM users"):
print(row)
# Batch writes in one transaction
with conn:
conn.executemany(
"INSERT INTO logs (ts, msg) VALUES (?, ?)",
[(1, "a"), (2, "b"), (3, "c")],
)
Step-by-Step
- Choose file location and open with pragmas (WAL).
- Create schema with constraints and indexes.
- Write with short transactions and
busy_timeout. - Query with parameters to avoid injection.
- Tune cache and synchronous for the workload.
- Back up with
.backup/VACUUM INTO. - Vacuum and re-analyze periodically.
- Test concurrency on the target platform.
Validation
- Writes and reads are consistent
- Concurrent reads work in WAL mode
- No SQLITE_BUSY under expected load
- Queries use indexes (EXPLAIN QUERY PLAN)
- Backup restores correctly
Troubleshooting
- SQLITE_BUSY: raise busy_timeout, shorten transactions.
- Database locked: check for open long transactions.
- Slow queries: add indexes; check
EXPLAIN QUERY PLAN.
When not to use it
- →When a client-server database architecture is required
- →When data persistence is not local or single-file
Limitations
- →Designed for local data persistence
- →Self-contained, serverless database engine
- →Zero-configuration setup
How it compares
This skill provides a zero-configuration, single-file approach to database management, suitable for embedded applications, unlike traditional client-server database systems.
Compared to similar skills
sqlite side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| sqlite (this skill) | 0 | 3mo | Review | Beginner |
| sql-optimization-patterns | 64 | 5mo | No flags | Advanced |
| drizzle-orm | 32 | 4mo | No flags | Intermediate |
| qdrant-vector-search | 18 | 11mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by ssrjkk
View all by ssrjkk →You might also like
sql-optimization-patterns
wshobson
Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries. Use when debugging slow queries, designing database schemas, or optimizing application performance.
drizzle-orm
EpicenterHQ
Drizzle ORM patterns for type branding and custom types. Use when working with Drizzle column definitions, branded types, or custom type conversions.
qdrant-vector-search
zechenzhangAGI
High-performance vector similarity search engine for RAG and semantic search. Use when building production RAG systems requiring fast nearest neighbor search, hybrid search with filtering, or scalable vector storage with Rust-powered performance.
postgres-patterns
affaan-m
PostgreSQL database patterns for query optimization, schema design, indexing, and security. Based on Supabase best practices.
postgresql-table-design
wshobson
Design a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features
agentdb-advanced-features
ruvnet
Master advanced AgentDB features including QUIC synchronization, multi-database management, custom distance metrics, hybrid search, and distributed systems integration. Use when building distributed AI systems, multi-agent coordination, or advanced vector search applications.