# Ecto v3.13.6 - API Reference

## Modules

- [Ecto](Ecto.md): Ecto is split into 4 main components
- [Ecto.Changeset](Ecto.Changeset.md): Changesets allow filtering, type casting, validation, and
constraints when manipulating structs, usually in preparation
for inserting and updating entries into a database.
- [Ecto.Multi](Ecto.Multi.md): `Ecto.Multi` is a data structure for grouping multiple Repo operations.
- [Ecto.Query](Ecto.Query.md): Provides the Query DSL.
- [Ecto.Repo](Ecto.Repo.md): Defines a repository.
- [Ecto.Schema](Ecto.Schema.md): An Ecto schema maps external data into Elixir structs.
- [Ecto.Schema.Metadata](Ecto.Schema.Metadata.md): Stores metadata of a struct.
- [Mix.Ecto](Mix.Ecto.md): Conveniences for writing Ecto related Mix tasks.

- Types
  - [Ecto.Enum](Ecto.Enum.md): A custom type that maps atoms to strings or integers.
  - [Ecto.ParameterizedType](Ecto.ParameterizedType.md): Parameterized types are Ecto types that can be customized per field.
  - [Ecto.Type](Ecto.Type.md): Defines functions and the `Ecto.Type` behaviour for implementing
basic custom types.
  - [Ecto.UUID](Ecto.UUID.md): An Ecto type for UUID strings.

- Query APIs
  - [Ecto.Query.API](Ecto.Query.API.md): Lists all functions allowed in the query API.
  - [Ecto.Query.WindowAPI](Ecto.Query.WindowAPI.md): Lists all windows functions.
  - [Ecto.Queryable](Ecto.Queryable.md): Converts a data structure into an `Ecto.Query`.
  - [Ecto.SubQuery](Ecto.SubQuery.md): A struct representing subqueries.

- Adapter specification
  - [Ecto.Adapter](Ecto.Adapter.md): Specifies the minimal API required from adapters.

  - [Ecto.Adapter.Queryable](Ecto.Adapter.Queryable.md): Specifies the query API required from adapters.
  - [Ecto.Adapter.Schema](Ecto.Adapter.Schema.md): Specifies the schema API required from adapters.

  - [Ecto.Adapter.Storage](Ecto.Adapter.Storage.md): Specifies the adapter storage API.

  - [Ecto.Adapter.Transaction](Ecto.Adapter.Transaction.md): Specifies the adapter transactions API.

- Relation structs
  - [Ecto.Association.BelongsTo](Ecto.Association.BelongsTo.md): The association struct for a `belongs_to` association.
  - [Ecto.Association.Has](Ecto.Association.Has.md): The association struct for `has_one` and `has_many` associations.
  - [Ecto.Association.HasThrough](Ecto.Association.HasThrough.md): The association struct for `has_one` and `has_many` through associations.
  - [Ecto.Association.ManyToMany](Ecto.Association.ManyToMany.md): The association struct for `many_to_many` associations.
  - [Ecto.Association.NotLoaded](Ecto.Association.NotLoaded.md): Struct returned by associations when they are not loaded.
  - [Ecto.Embedded](Ecto.Embedded.md): The embedding struct for `embeds_one` and `embeds_many`.

- Exceptions
  - [Ecto.CastError](Ecto.CastError.md): Raised when a changeset can't cast a value.

  - [Ecto.ChangeError](Ecto.ChangeError.md)
  - [Ecto.ConstraintError](Ecto.ConstraintError.md)
  - [Ecto.InvalidChangesetError](Ecto.InvalidChangesetError.md): Raised when we cannot perform an action because the
changeset is invalid.

  - [Ecto.InvalidURLError](Ecto.InvalidURLError.md)
  - [Ecto.MigrationError](Ecto.MigrationError.md)
  - [Ecto.MultiplePrimaryKeyError](Ecto.MultiplePrimaryKeyError.md)
  - [Ecto.MultipleResultsError](Ecto.MultipleResultsError.md)
  - [Ecto.NoPrimaryKeyFieldError](Ecto.NoPrimaryKeyFieldError.md): Raised at runtime when an operation that requires a primary key is invoked
with a schema that does not define a primary key by using `@primary_key false`

  - [Ecto.NoPrimaryKeyValueError](Ecto.NoPrimaryKeyValueError.md): Raised at runtime when an operation that requires a primary key is invoked
with a schema missing value for its primary key

  - [Ecto.NoResultsError](Ecto.NoResultsError.md)
  - [Ecto.Query.CastError](Ecto.Query.CastError.md): Raised at runtime when a value cannot be cast.

  - [Ecto.Query.CompileError](Ecto.Query.CompileError.md): Raised at compilation time when the query cannot be compiled.

  - [Ecto.QueryError](Ecto.QueryError.md): Raised at runtime when the query is invalid.

  - [Ecto.StaleEntryError](Ecto.StaleEntryError.md)
  - [Ecto.SubQueryError](Ecto.SubQueryError.md): Raised at runtime when a subquery is invalid.

## Mix Tasks

- [mix ecto](Mix.Tasks.Ecto.md): Prints Ecto tasks and their information.
- [mix ecto.create](Mix.Tasks.Ecto.Create.md): Create the storage for the given repository.
- [mix ecto.drop](Mix.Tasks.Ecto.Drop.md): Drop the storage for the given repository.
- [mix ecto.gen.repo](Mix.Tasks.Ecto.Gen.Repo.md): Generates a new repository.

