API Reference
Modules
Ecto is split into 4 main components:
This module specifies the adapter API that an adapter is required to implement
Specifies the adapter migrations API
Specifies the adapter storage API
Specifies the adapter transactions API
Behaviour for adapters that rely on connections
Adapter module for MySQL
Adapter module for PostgreSQL
Behaviour and implementation for SQL adapters
Specifies the behaviour to be implemented by the connection for handling all SQL queries
Start a pool with a single sandboxed SQL connection
The association struct for a belongs_to
association
The association struct for has_one
and has_many
associations
The association struct for has_one
and has_many
through associations
Struct returned by one to one associations when they are not loaded
Changesets allow filtering, casting, validation and definition of constraints when manipulating models
An Ecto type for dates
An Ecto type that includes a date and a time
Migrations are used to modify your database schema over time
Defines an index struct used in migrations
Defines a reference struct used in migrations
Defines a table struct used in migrations
This module provides the migration API
Provides convenience functions for defining and working with models
Handle autogenerate columns via callbacks
Define module-level callbacks in models
Defines callbacks for handling dependencies (associations)
Facilities for using the optimistic-locking technique
Automatically manage timestamps
Behaviour for using a pool of connections
Start a pool of connections using poolboy
Start a pool of connections using sbroker
CoDel based broker
Timeout based broker
Provides the Query DSL
This module lists all functions allowed in the query API
Defines a repository
Defines a schema for a model
Stores metadata of a struct
Convenience functions around the data store of a repository
An Ecto type for time
An Ecto type for UUIDs strings
Create the storage for the repository
Drop the storage for the repository
Generates a migration
Generates a new repository
Runs the pending migrations for the given repository
Reverts applied migrations in the given repository
Exceptions
Raised at runtime when a value cannot be cast
Raised when we cannot perform an action because the changeset is invalid
Raised at runtime when an operation that requires a primary key is invoked
with a model that does not define a primary key by using @primary_key false
Raised at runtime when an operation that requires a primary key is invoked with a model missing value for it’s primary key
Raised at compilation time when the query cannot be compiled
Raised at runtime when the query is invalid
Protocols
Converts a data structure into an Ecto.Query