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

  1. Choose ORM path (SQLAlchemy or Piccolo) based on ecosystem and project constraints.
  2. For SQLAlchemy, choose plugin strategy first (SQLAlchemyPlugin vs SQLAlchemyInitPlugin + optional SQLAlchemySerializationPlugin).
  3. Configure engine + session factory centrally at app initialization (async or sync).
  4. Define model/repository/service boundaries and keep transaction ownership explicit.
  5. Integrate dependency injection so handlers receive a scoped session/unit-of-work.
  6. Define DTO and serialization boundaries at API edges (never leak raw ORM internals unintentionally).
  7. Validate lifecycle behavior: startup initialization, request cleanup/rollback, and lazy-loading behavior in hot paths.

Implementation Rules

  • Keep transactions explicit and short-lived; commit where business operations complete, rollback on failure paths.
  • Keep repositories/services free of HTTP transport concerns.
  • Keep session ownership deterministic; handlers should not guess who closes/rolls back a session.
Related skills

More from alti3/litestar-skills

Installs
16
GitHub Stars
5
First Seen
Mar 2, 2026