ecto-thinking
Installation
SKILL.md
Ecto Thinking
Resumo (pt-BR): Contexto como bounded context (DDD). Entre contextos use IDs, não associations. Múltiplos changesets por schema; preload vs join; gotchas com CTE, pgbouncer, sandbox e null bytes.
Mental shifts for Ecto and data layer design. These insights challenge typical ORM patterns.
Context = Setting That Changes Meaning
Context isn't just a namespace—it changes what words mean. Think top-down: Subdomain → Context → Entity.
Cross-Context References: IDs, Not Associations
Use field :product_id, :integer in another context; query through the context, not across associations. Keeps contexts independent and testable.
DDD Patterns as Pipelines
Build → validate → insert. Use events (as data structs) to compose bounded contexts with minimal coupling.