advanced-alchemy-database-seeding

Installation
SKILL.md

Database Seeding

Execution Workflow

  1. Store fixtures as JSON objects or arrays of objects in a dedicated fixtures directory.
  2. Use open_fixture() for sync code or open_fixture_async() for async code.
  3. Create repository instances inside a real session and load fixture records in batches.
  4. Seed parent tables before child tables and make the process idempotent when possible.
  5. Wire seeding into startup hooks, dedicated commands, or one-off scripts based on environment needs.

Implementation Rules

  • Keep fixture files versioned alongside the application code.
  • Use add_many() or upsert_many() instead of row-by-row inserts for non-trivial datasets.
  • Separate development, test, and production seed data explicitly.
  • Do not hide seeding in normal request paths.

Example Pattern

Related skills

More from alti3/litestar-skills

Installs
7
GitHub Stars
5
First Seen
Mar 9, 2026