Ecto v3.1.7 Ecto.Adapter.Queryable behaviour View Source
Specifies the query API required from adapters.
If your adapter is only able to respond to one or a couple of the query functions,
add custom implementations of those functions directly to the Repo
by using Ecto.Adapter.__before_compile__/1
instead.
Link to this section Summary
Types
Proxy type to the adapter meta
Cache query metadata
Ecto.Query metadata fields (stored in cache)
Functions
Plans a query using the given adapter.
Plans and prepares a query for the given repo, leveraging its query cache.
Callbacks
Executes a previously prepared query.
Commands invoked to prepare a query for all
, update_all
and delete_all
.
Streams a previously prepared query.
Link to this section Types
adapter_meta()
View Source
adapter_meta() :: Ecto.Adapter.adapter_meta()
adapter_meta() :: Ecto.Adapter.adapter_meta()
Proxy type to the adapter meta
cached()
View Source
cached() :: term()
cached() :: term()
options()
View Source
options() :: Keyword.t()
options() :: Keyword.t()
prepared()
View Source
prepared() :: term()
prepared() :: term()
query_cache() View Source
Cache query metadata
query_meta() View Source
Ecto.Query metadata fields (stored in cache)
Link to this section Functions
plan_query(operation, adapter, queryable) View Source
Plans a query using the given adapter.
This does not expect the repository and therefore does not leverage the cache.
prepare_query(operation, repo_name_or_pid, queryable) View Source
Plans and prepares a query for the given repo, leveraging its query cache.
This operation uses the query cache if one is available.
Link to this section Callbacks
execute(adapter_meta, query_meta, query_cache, params, options)
View Source
execute(
adapter_meta(),
query_meta(),
query_cache(),
params :: list(),
options()
) :: {integer(), [[term()]] | nil}
execute( adapter_meta(), query_meta(), query_cache(), params :: list(), options() ) :: {integer(), [[term()]] | nil}
Executes a previously prepared query.
It must return a tuple containing the number of entries and
the result set as a list of lists. The result set may also be
nil
if a particular operation does not support them.
The adapter_meta
field is a map containing some of the fields found
in the Ecto.Query
struct.
prepare(atom, query)
View Source
prepare(atom :: :all | :update_all | :delete_all, query :: Ecto.Query.t()) ::
{:cache, prepared()} | {:nocache, prepared()}
prepare(atom :: :all | :update_all | :delete_all, query :: Ecto.Query.t()) :: {:cache, prepared()} | {:nocache, prepared()}
Commands invoked to prepare a query for all
, update_all
and delete_all
.
The returned result is given to execute/6
.
stream(adapter_meta, query_meta, query_cache, params, options)
View Source
stream(adapter_meta(), query_meta(), query_cache(), params :: list(), options()) ::
Enumerable.t()
stream(adapter_meta(), query_meta(), query_cache(), params :: list(), options()) :: Enumerable.t()
Streams a previously prepared query.
It returns a stream of values.
The adapter_meta
field is a map containing some of the fields found
in the Ecto.Query
struct.