sqlite-ops
Implements SQLite best practices in Python for improved concurrency, safety, and performance.
Install
mkdir -p .claude/skills/sqlite-ops-aiskillstore && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/19533" && unzip -o skill.zip -d .claude/skills/sqlite-ops-aiskillstore && rm skill.zipInstalls to .claude/skills/sqlite-ops-aiskillstore
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.
Patterns for SQLite databases in Python projects - state management, caching, and async operations. Triggers on: sqlite, sqlite3, aiosqlite, local database, database schema, migration, wal mode.Key capabilities
- →Configure SQLite connection with WAL mode
- →Implement context managers for database transactions
- →Execute CLI commands for schema inspection
- →Manage database concurrency settings
- →Export database content to CSV
How it works
The skill provides Python code templates for managing SQLite connections, enabling WAL mode for concurrency, and using context managers to handle transaction commits and rollbacks.
Inputs & outputs
When to use sqlite-ops
- →Configure concurrent read-write access using WAL mode
- →Implement context managers for database transactions
- →Debug database locked errors
- →Check database schema or tables via CLI
About this skill
SQLite Operations
Patterns for SQLite databases in Python projects.
Quick Connection
import sqlite3
def get_connection(db_path: str) -> sqlite3.Connection:
conn = sqlite3.connect(db_path, check_same_thread=False)
conn.row_factory = sqlite3.Row # Dict-like access
conn.execute("PRAGMA journal_mode=WAL") # Better concurrency
conn.execute("PRAGMA foreign_keys=ON")
return conn
Context Manager Pattern
from contextlib import contextmanager
@contextmanager
def db_transaction(conn: sqlite3.Connection):
try:
yield conn
conn.commit()
except Exception:
conn.rollback()
raise
WAL Mode
Enable for concurrent read/write:
conn.execute("PRAGMA journal_mode=WAL")
| Mode | Reads | Writes | Best For |
|---|---|---|---|
| DELETE (default) | Blocked during write | Single | Simple scripts |
| WAL | Concurrent | Single | Web apps, MCP servers |
Common Gotchas
| Issue | Solution |
|---|---|
| "database is locked" | Use WAL mode |
| Slow queries | Add indexes, check EXPLAIN QUERY PLAN |
| Thread safety | Use check_same_thread=False |
| FK not enforced | Run PRAGMA foreign_keys=ON |
CLI Quick Reference
sqlite3 mydb.sqlite # Open database
.tables # Show tables
.schema items # Show schema
.headers on && .mode csv && .output data.csv # Export CSV
VACUUM; # Reclaim space
When to Use
- Local state/config storage
- Caching layer
- Event logging
- MCP server persistence
- Small to medium datasets
Additional Resources
For detailed patterns, load:
./references/schema-patterns.md- State, cache, event, queue table designs./references/async-patterns.md- aiosqlite CRUD, batching, connection pools./references/migration-patterns.md- Version migrations, JSON handling
When not to use it
- →High-concurrency write-heavy production environments
- →Distributed database applications
Prerequisites
Limitations
- →WAL mode supports only single concurrent writer
- →Requires manual index management for performance
How it compares
Unlike manual connection handling, this skill provides pre-configured patterns for concurrency and transaction safety specifically for Python projects.
Compared to similar skills
sqlite-ops side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| sqlite-ops (this skill) | 0 | 22d | Review | Beginner |
| django-pro | 20 | 3mo | No flags | Intermediate |
| senior-backend | 14 | 7mo | Review | Advanced |
| supabase-python | 0 | 3mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by aiskillstore
View all by aiskillstore →You might also like
django-pro
sickn33
Master Django 5.x with async views, DRF, Celery, and Django Channels. Build scalable web applications with proper architecture, testing, and deployment. Use PROACTIVELY for Django development, ORM optimization, or complex Django patterns.
senior-backend
davila7
Comprehensive backend development skill for building scalable backend systems using NodeJS, Express, Go, Python, Postgres, GraphQL, REST APIs. Includes API scaffolding, database optimization, security implementation, and performance tuning. Use when designing APIs, optimizing database queries, implementing business logic, handling authentication/authorization, or reviewing backend code.
supabase-python
alinaqi
FastAPI with Supabase and SQLAlchemy/SQLModel
more-vaults
tradingstrategy-ai
Add more vault smart contract types to an existing protocol
pagination
dadbodgeoff
Implement cursor-based and offset pagination for APIs. Covers efficient database queries, stable sorting, and pagination metadata.
moai-domain-backend
modu-ai
Backend development specialist covering API design, database integration, microservices architecture, and modern backend patterns.