Oban.Repo (Oban v2.4.0) View Source
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 Types
Specs
Link to this section Functions
Specs
all(config(), Ecto.Queryable.t(), Keyword.t()) :: [Ecto.Schema.t()]
Wraps Ecto.Repo.all/2
.
Specs
Wraps Ecto.Repo.checkout/2
.
Specs
Wraps Ecto.Repo.config/0
.
Specs
delete( config(), 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(config(), Ecto.Queryable.t(), Keyword.t()) :: {integer(), nil | [term()]}
Wraps Ecto.Repo.delete_all/2
.
Specs
insert(config(), 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( config(), binary() | {binary(), module()} | module(), [map() | [{atom(), term() | Ecto.Query.t()}]], Keyword.t() ) :: {integer(), nil | [term()]}
Wraps Ecto.Repo.insert_all/3
.
Specs
one(config(), Ecto.Queryable.t(), Keyword.t()) :: Ecto.Schema.t() | nil
Wraps Ecto.Repo.one/2
.
Specs
query(config(), 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
to_sql(config(), :all | :update_all | :delete_all, Ecto.Queryable.t()) :: {String.t(), [term()]}
Wraps Ecto.Adapters.SQL.Repo.to_sql/2
.
Specs
transaction(config(), (... -> 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(config(), Ecto.Changeset.t(), Keyword.t()) :: {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}
Wraps Ecto.Repo.update/2
.
Specs
Wraps Ecto.Repo.update_all/3
.