Ecto.Multi.delete

You're seeing just the function delete, go back to Ecto.Multi module for more information.
Link to this function

delete(multi, name, changeset_or_struct_fun, opts \\ [])

View Source

Specs

Adds a delete operation to the multi.

Accepts the same arguments and options as Ecto.Repo.delete/2 does.

Example

post = MyApp.Repo.get!(Post, 1)
Ecto.Multi.new()
|> Ecto.Multi.delete(:delete, post)
|> MyApp.Repo.transaction()

Ecto.Multi.new()
|> Ecto.Multi.run(:post, fn repo, _changes ->
     case repo.get(Post, 1) do
       nil -> {:error, :not_found}
       post -> {:ok, post}
     end
   end)
|> Ecto.Multi.delete(:delete, fn %{post: post} ->
     # Others validations
     post
   end)
|> MyApp.Repo.transaction()