Ecto.Multi.inspect
You're seeing just the function
inspect
, go back to Ecto.Multi module for more information.
Specs
Inspects results from a Multi
By default, the name is shown as a label to the inspect, custom labels are
supported through the IO.inspect/2
label
option.
Options
All options for IO.inspect/2 are supported, it also support the following ones:
:only
- A field or a list of fields to inspect, will print the entire map by default.
Examples
Ecto.Multi.new()
|> Ecto.Multi.insert(:person_a, changeset)
|> Ecto.Multi.insert(:person_b, changeset)
|> Ecto.Multi.inspect()
|> MyApp.Repo.transaction()
Prints:
%{person_a: %Person{...}, person_b: %Person{...}}
We can use the :only
option to limit which fields will be printed:
Ecto.Multi.new()
|> Ecto.Multi.insert(:person_a, changeset)
|> Ecto.Multi.insert(:person_b, changeset)
|> Ecto.Multi.inspect(only: :person_a)
|> MyApp.Repo.transaction()
Prints:
%{person_a: %Person{...}}