Write operations generated by use BoxTurtle.Schema.Change: create, update and delete.
The counterpart to BoxTurtle.Schema.Query.API, with the idea that nothing outside a Query or Change module
touches the Repo. Plain functions return {:ok, struct} / {:error, changeset} like Ecto.Repo; !
functions return the struct or raise.
Summary
Callbacks
Inserts a changeset, or a changeset built from a map (or struct) of attributes.
Deletes a struct, a changeset, or the row with the given primary key ({:error, :not_found} if absent).
Updates a changeset, or a struct with a map of changes.
Types
Callbacks
@callback create(attrs() | Ecto.Changeset.t()) :: {:ok, schema()} | {:error, Ecto.Changeset.t()}
Inserts a changeset, or a changeset built from a map (or struct) of attributes.
@callback create!(attrs() | Ecto.Changeset.t()) :: schema()
@callback delete(key() | schema() | Ecto.Changeset.t()) :: {:ok, schema()} | {:error, Ecto.Changeset.t() | :not_found}
Deletes a struct, a changeset, or the row with the given primary key ({:error, :not_found} if absent).
@callback delete!(key() | schema() | Ecto.Changeset.t()) :: schema()
@callback update(Ecto.Changeset.t()) :: {:ok, schema()} | {:error, Ecto.Changeset.t()}
Updates a changeset, or a struct with a map of changes.
@callback update(schema(), map()) :: {:ok, schema()} | {:error, Ecto.Changeset.t()}
@callback update!(Ecto.Changeset.t()) :: schema()