SQLite Operations Patterns for SQLite databases in Python projects. Quick Connection Context Manager Pattern WAL Mode Enable for concurrent read/write: | 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 | | FK not enforced | Run | CLI Quick Reference When to Use - Local state…