View Source Oban.Repo (Oban v2.11.0)
Wrappers around Ecto.Repo
callbacks.
These functions should be used when working with an Ecto repo inside a plugin. These functions will resolve the correct repo instance, and set the schema prefix and the log level, according to the Oban configuration.
Link to this section Summary
Functions
Wraps Ecto.Repo.config/0
.
Wraps Ecto.Adapters.SQL.Repo.query/4
.
Wraps Ecto.Adapters.SQL.Repo.to_sql/2
.
Link to this section Functions
Specs
all(Oban.Config.t(), Ecto.Queryable.t(), Keyword.t()) :: [Ecto.Schema.t()]
Wraps Ecto.Repo.all/2
.
Specs
checkout(Oban.Config.t(), (() -> result), Keyword.t()) :: result when result: var
Wraps Ecto.Repo.checkout/2
.
Specs
config(Oban.Config.t()) :: Keyword.t()
Wraps Ecto.Repo.config/0
.
Specs
delete( Oban.Config.t(), struct_or_changeset :: Ecto.Schema.t() | Ecto.Changeset.t(), opts :: Keyword.t() ) :: {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}
Wraps Ecto.Repo.delete/2
.
Specs
delete_all(Oban.Config.t(), Ecto.Queryable.t(), Keyword.t()) :: {integer(), nil | [term()]}
Wraps Ecto.Repo.delete_all/2
.
Specs
insert(Oban.Config.t(), Ecto.Schema.t() | Ecto.Changeset.t(), Keyword.t()) :: {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}
Wraps Ecto.Repo.insert/2
.
Link to this function
insert_all(conf, schema_or_source, entries, opts \\ [])
View Source (since 2.2.0)Specs
insert_all( Oban.Config.t(), binary() | {binary(), module()} | module(), [map() | [{atom(), term() | Ecto.Query.t()}]], Keyword.t() ) :: {integer(), nil | [term()]}
Wraps Ecto.Repo.insert_all/3
.
Specs
one(Oban.Config.t(), Ecto.Queryable.t(), Keyword.t()) :: Ecto.Schema.t() | nil
Wraps Ecto.Repo.one/2
.
Specs
query(Oban.Config.t(), String.t(), [term()], Keyword.t()) :: {:ok, %{ :rows => nil | [[term()] | binary()], :num_rows => non_neg_integer(), optional(atom()) => any() }} | {:error, Exception.t()}
Wraps Ecto.Adapters.SQL.Repo.query/4
.
Specs
stream(Oban.Config.t(), Ecto.Queryable.t(), Keyword.t()) :: Enum.t()
Wraps Ecto.Repo.stream/2
Specs
to_sql(Oban.Config.t(), :all | :update_all | :delete_all, Ecto.Queryable.t()) :: {String.t(), [term()]}
Wraps Ecto.Adapters.SQL.Repo.to_sql/2
.
Specs
transaction( Oban.Config.t(), (... -> any()) | Ecto.Multi.t(), opts :: Keyword.t() ) :: {:ok, any()} | {:error, any()} | {:error, Ecto.Multi.name(), any(), %{required(Ecto.Multi.name()) => any()}}
Wraps Ecto.Repo.transaction/2
.
Specs
update(Oban.Config.t(), Ecto.Changeset.t(), Keyword.t()) :: {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}
Wraps Ecto.Repo.update/2
.
Specs
update_all(Oban.Config.t(), Ecto.Queryable.t(), Keyword.t(), Keyword.t()) :: {integer(), nil | [term()]}
Wraps Ecto.Repo.update_all/3
.