Ecto.Adapter behaviour

This module specifies the adapter API that an adapter is required to implement.

Source

Types

t :: module

Callbacks

__using__/1

The callback invoked when the adapter is used.

Source
all/3

Specs:

Fetches all results from the data store based on the given query.

Source
delete/3

Specs:

Deletes an model using the primary key as key.

Source
delete_all/3

Specs:

Deletes all entities matching the given query. The query will only have where expressions and a single from expression. Returns the number of affected entities.

Source
insert/3

Specs:

Stores a single new model in the data store. Return the default values.

Source
start_link/2

Specs:

  • start_link(Ecto.Repo.t, Keyword.t) :: {:ok, pid} | :ok | {:error, {:already_started, pid}} | {:error, term}

Starts any connection pooling or supervision and return {:ok, pid} or just :ok if nothing needs to be done.

Returns {:error, {:already_started, pid}} if the repo already started or {:error, term} in case anything else goes wrong.

Source
stop/1

Specs:

Stops any connection pooling or supervision started with start_link/1.

Source
update/3

Specs:

Updates an model using the primary key as key.

Source
update_all/5

Specs:

Updates all entities matching the given query with the values given. The query will only have where expressions and a single from expression. Returns the number of affected entities.

Source