ecto-essentials
Installation
SKILL.md
Ecto Essentials
RULES — Follow these with no exceptions
- Always use changesets for inserts and updates — never pass raw maps to Repo
- Preload associations before accessing them — avoid N+1 queries
- Use transactions for multi-step operations that must succeed together
- Add database constraints (unique_index, foreign_key, check_constraint) AND changeset validations
- Use contexts for database access — never call Repo directly from web layer
- Add indexes on foreign keys and frequently queried fields
- Use timestamps() in every schema — track when records were created/updated
Schema Definition
Define schemas with proper types and associations.