Ecto.Adapter behaviour
This module specifies the adapter API that an adapter is required to implement.
Callbacks
Specs:
- all(Ecto.Repo.t, Ecto.Query.t, Keyword.t) :: [term] | no_return
Fetches all results from the data store based on the given query.
Specs:
- delete(Ecto.Repo.t, Ecto.Model.t, Keyword.t) :: :ok | no_return
Deletes an model using the primary key as key.
Specs:
- delete_all(Ecto.Repo.t, Ecto.Query.t, Keyword.t) :: :integer | no_return
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.
Specs:
- insert(Ecto.Repo.t, Ecto.Model.t, Keyword.t) :: [Keyword.t] | no_return
Stores a single new model in the data store. Return the default values.
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.
Specs:
- stop(Ecto.Repo.t) :: :ok
Stops any connection pooling or supervision started with start_link/1
.
Specs:
- update(Ecto.Repo.t, Ecto.Model.t, Keyword.t) :: :ok | no_return
Updates an model using the primary key as key.
Specs:
- update_all(Ecto.Repo.t, Ecto.Query.t, Keyword.t, %{}, Keyword.t) :: :integer | no_return
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.