skills/database/sqlite/SKILL.md
SQLite specialist focused on embedded database design, optimization, and best practices. Use for SQLite-specific patterns including WAL mode, type affinity, FTS5 full-text search, and PRAGMA configuration.
npx skillsauth add simplerick0/com.ackhax.configs sqliteInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are a SQLite specialist focused on embedded database design, optimization, and best practices.
# CLI access
sqlite3 database.db
# Schema inspection
sqlite3 database.db ".schema"
sqlite3 database.db ".tables"
# Query plan analysis
sqlite3 database.db "EXPLAIN QUERY PLAN SELECT ..."
# Integrity check
sqlite3 database.db "PRAGMA integrity_check;"
# Database info
sqlite3 database.db "PRAGMA page_count; PRAGMA page_size;"
-- SQLite uses type affinity, not strict types
-- INTEGER, TEXT, BLOB, REAL, NUMERIC
-- Use STRICT tables for type enforcement (3.37+)
CREATE TABLE users (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
balance REAL
) STRICT;
-- ROWID is automatic, INTEGER PRIMARY KEY aliases it
CREATE TABLE items (
id INTEGER PRIMARY KEY, -- Aliases rowid
name TEXT
);
-- True auto-increment (no rowid reuse)
CREATE TABLE logs (
id INTEGER PRIMARY KEY AUTOINCREMENT,
message TEXT
);
-- JSON functions (3.38+)
CREATE TABLE events (
id INTEGER PRIMARY KEY,
data TEXT -- Store JSON
);
-- Query JSON
SELECT json_extract(data, '$.name') FROM events;
SELECT data->>'$.name' FROM events; -- 3.38+ shorthand
-- FTS5 for text search
CREATE VIRTUAL TABLE docs_fts USING fts5(
title, content,
content='docs',
content_rowid='id'
);
-- Search
SELECT * FROM docs_fts WHERE docs_fts MATCH 'search term';
-- Performance tuning
PRAGMA journal_mode = WAL; -- Write-ahead logging
PRAGMA synchronous = NORMAL; -- Balance safety/speed
PRAGMA cache_size = -64000; -- 64MB cache
PRAGMA temp_store = MEMORY; -- Temp tables in memory
PRAGMA mmap_size = 268435456; -- Memory-map 256MB
-- For read-heavy workloads
PRAGMA read_uncommitted = ON; -- Skip locks for reads
-- Covering index (includes all query columns)
CREATE INDEX idx_orders_covering
ON orders(customer_id, status, created_at, total);
-- Partial index
CREATE INDEX idx_active_users
ON users(email) WHERE active = 1;
-- Expression index
CREATE INDEX idx_lower_email
ON users(lower(email));
BEGIN IMMEDIATE for write transactionsPRAGMA busy_timeout = 5000;import sqlite3
from contextlib import contextmanager
@contextmanager
def get_db(path: str):
conn = sqlite3.connect(path)
conn.row_factory = sqlite3.Row
conn.execute("PRAGMA foreign_keys = ON")
conn.execute("PRAGMA journal_mode = WAL")
try:
yield conn
finally:
conn.close()
# Usage
with get_db("app.db") as conn:
cursor = conn.execute("SELECT * FROM users WHERE id = ?", (user_id,))
user = cursor.fetchone()
PRAGMA foreign_keys = ON).backup command or file copy (with WAL checkpoint)development
Manage VSCode/Cursor configuration in this dotfiles repository. Use when working with settings.json, keybindings.json, or tasks.json files, or when asked about VSCode/Cursor configuration structure.
tools
Design user interfaces and experiences for web applications without requiring design tools. Use for wireframing in text/ASCII, defining user flows, creating component hierarchies, establishing design systems, planning responsive layouts, and making accessibility decisions.
development
Testing specialist focused on comprehensive test coverage for Python applications. Use for pytest patterns, unit/integration/E2E testing, fixtures, mocking, property-based testing with Hypothesis, and factory patterns.
development
Project management adapted for solo developers working without a team. Use for personal project planning, time-boxing work sessions, managing scope creep alone, maintaining momentum on side projects, tracking progress without overhead, making decisions without external input, and staying accountable to yourself.