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.zip

Installs 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.
120 chars✓ has a “when” trigger
Beginner

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

You give it
SQL commands for database creation, schema definition, and data manipulation
You get back
A SQLite database file with defined schema and populated data

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 STRICT tables (SQLite 3.37+) for typed data

Concurrency

  • Enable WAL mode for concurrent readers
  • Use short write transactions
  • Set busy_timeout to avoid SQLITE_BUSY
  • Avoid long-running read transactions

Performance

  • Index columns used in WHERE/JOIN
  • Use PRAGMA to tune (cache_size, mmap)
  • Batch writes in transactions
  • VACUUM periodically to reclaim space

Durability

  • Choose journal mode by need (WAL vs DELETE)
  • Set synchronous=NORMAL in WAL for speed
  • Back up via .backup or 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

  1. Choose file location and open with pragmas (WAL).
  2. Create schema with constraints and indexes.
  3. Write with short transactions and busy_timeout.
  4. Query with parameters to avoid injection.
  5. Tune cache and synchronous for the workload.
  6. Back up with .backup/VACUUM INTO.
  7. Vacuum and re-analyze periodically.
  8. Test concurrency on the target platform.

Validation

  1. Writes and reads are consistent
  2. Concurrent reads work in WAL mode
  3. No SQLITE_BUSY under expected load
  4. Queries use indexes (EXPLAIN QUERY PLAN)
  5. 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.

SkillInstallsUpdatedSafetyDifficulty
sqlite (this skill)03moReviewBeginner
sql-optimization-patterns645moNo flagsAdvanced
drizzle-orm324moNo flagsIntermediate
qdrant-vector-search1811moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry