Ecto v3.3.2 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 Ecto.Repo.all/2
, Ecto.Repo.update_all/3
,
and Ecto.Repo.delete_all/2
.
Streams a previously prepared query.
Link to this section Types
Proxy type to the adapter meta
Cache query metadata
Ecto.Query metadata fields (stored in cache)
Link to this section Functions
Plans a query using the given adapter.
This does not expect the repository and therefore does not leverage the cache.
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 Sourceexecute( 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 Sourceprepare(atom :: :all | :update_all | :delete_all, query :: Ecto.Query.t()) :: {:cache, prepared()} | {:nocache, prepared()}
Commands invoked to prepare a query for Ecto.Repo.all/2
, Ecto.Repo.update_all/3
,
and Ecto.Repo.delete_all/2
.
The returned result is given to execute/5
.
stream(adapter_meta, query_meta, query_cache, params, options)
View Sourcestream(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.