persisting-data-with-typeorm
Installation
SKILL.md
Persisting Data with TypeORM
When to use
- Adding persistence to a feature
- Refactoring leaky ORM usage (entities with
@Entity()in domain) - Handling transactions across aggregates
Core rules
- Domain entities: no ORM decorators, live in
domain/ - ORM models (with
@Entity()) live ininfrastructure/ - Repository port in
application/ports/, TypeORM implementation ininfrastructure/ - Transactions explicit via
QueryRunneror@Transaction()decorator - Map between domain entity ↔ ORM model in repository