SKILL.md
486 lines · 1,807 words
ORM Specialist
Purpose
Select, configure, and optimize ORMs for production applications. This skill covers ORM patterns, performance pitfalls, query optimization, transaction management, and the decision framework for when to use (or bypass) an ORM.
ORM Pattern Selection
Active Record vs Data Mapper
ACTIVE RECORD:
The model class contains both data AND database logic.
Model.find(), model.save(), model.delete()
ORMS: Sequelize, ActiveRecord (Ruby), Eloquent (Laravel)
PROS:
+ Simple, intuitive API
+ Fast prototyping
+ Less boilerplate
CONS:
- Business logic and persistence mixed
- Harder to test (models depend on database)
# ... (condensed) ...
RECOMMENDATION:
Small projects/prototypes: Active Record
Large/enterprise projects: Data Mapper
TypeScript projects: Prisma (unique approach, excellent DX)