Ecto v2.0.0-rc.4 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 structure API

Specifies the adapter transactions API

Adapter module for MySQL

Adapter module for PostgreSQL

Behaviour and implementation for SQL adapters

Specifies the behaviour to be implemented by all SQL connections

A pool for concurrent transactional tests

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

The association struct for many_to_many associations

Struct returned by one to one associations when they are not loaded

Changesets allow filtering, casting, validation and definition of constraints when manipulating structs

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 a Constraint struct used in migrations

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

Warning: this module is currently deprecated. Instead use Ecto.Schema and the functions in the Ecto module

Ecto.Multi is a data structure that allows grouping multiple Repo operations together

Provides the Query DSL

This module lists all functions allowed in the query API

Defines a repository

Defines a schema

Stores metadata of a struct

An Ecto type for time

Defines functions and the Ecto.Type behaviour for implementing custom types

An Ecto type for UUIDs strings

Create the storage for the repository

Drop the storage for the repository

Dumps the current environment’s database structure into a structure file

Generates a migration

Generates a new repository

Loads the current environment’s database structure from a previously dumped structure file

Runs the pending migrations for the given repository

Reverts applied migrations in the given repository

Exceptions

Raised when a changeset can’t cast a value

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 schema 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 schema missing value for its primary key

Raised at runtime when a value cannot be cast

Raised at compilation time when the query cannot be compiled

Raised at runtime when the query is invalid

Raised at runtime when a subquery is invalid

Protocols

Casts and dumps a given struct into an Ecto type

Converts a data structure into an Ecto.Query