Context
The storage layer was using raw SQLite with hand-written SQL. As the schema grew (FTS5, links, tags, plugin tables), migration management became error-prone.
Decision
Migrate to SQLAlchemy ORM for the data model and add Alembic for schema migrations. Keep the raw connection available for FTS5 queries which SQLAlchemy doesn't handle natively.