ecto
Ecto is a domain-specific language and toolkit for data mapping and persistence in Elixir applications. It provides a consistent way to define how data is structured, loaded from and stored to a database, and how changes are validated and applied. Ecto focuses on a repository pattern and a composable query DSL, enabling developers to write database operations that are explicit, testable, and free from ad-hoc SQL.
Key components include the Ecto.Repo, which acts as a database wrapper; Ecto.Schema for mapping Elixir structs
Ecto supports associations (has_many, belongs_to), embeds for nested data, and preloading of associations to avoid N+1
Applications typically define schemas, write changesets, and interact with the database via Repo functions (insert, update,