litestar-databases
Installation
SKILL.md
Databases
Use this skill when persistence architecture and ORM integration are core to the task, especially SQLAlchemy plugin wiring or Piccolo DTO-based API flows.
Execution Workflow
- Choose ORM path (
SQLAlchemyorPiccolo) based on ecosystem and project constraints. - For SQLAlchemy, choose plugin strategy first (
SQLAlchemyPluginvsSQLAlchemyInitPlugin+ optionalSQLAlchemySerializationPlugin). - Configure engine + session factory centrally at app initialization (async or sync).
- Define model/repository/service boundaries and keep transaction ownership explicit.
- Integrate dependency injection so handlers receive a scoped session/unit-of-work.
- Define DTO and serialization boundaries at API edges (never leak raw ORM internals unintentionally).
- Validate lifecycle behavior: startup initialization, request cleanup/rollback, and lazy-loading behavior in hot paths.