LazyContext v0.1.2-dev LazyContext.Examples.Animals View Source

An example context to demonstrate features the LazyContext library

Link to this section Summary

Functions

Returns a data structure for tracking %Elixir.LazyContext.Examples.Animals.Schemas.Cat{} changes.

Examples

iex> change_cat(%Elixir.LazyContext.Examples.Animals.Schemas.Cat{}, %{field: value}) %Ecto.Changeset{}

Returns a data structure for tracking %Elixir.LazyContext.Examples.Animals.Schemas.Dog{} changes.

Examples

iex> change_dog(%Elixir.LazyContext.Examples.Animals.Schemas.Dog{}, %{field: value}) %Ecto.Changeset{}

Returns a data structure for tracking %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{} changes.

Examples

iex> change_ferret(%Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}, %{field: value}) %Ecto.Changeset{}

Creates an “empty” %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}, if valid. Equivalent to calling create_cat(%{})

Examples

iex> create_cat() {:ok, %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}}

Creates a %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}

Creates an “empty” %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}, if valid. Equivalent to calling create_cat!(%{})

Creates a %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}

Creates an “empty” %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}, if valid. Equivalent to calling create_dog(%{})

Examples

iex> create_dog() {:ok, %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}}

Creates a %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}

Creates an “empty” %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}, if valid. Equivalent to calling create_dog!(%{})

Creates a %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}

Creates an “empty” %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}, if valid. Equivalent to calling create_ferret(%{})

Examples

iex> create_ferret() {:ok, %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}}

Creates a %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}

Creates an “empty” %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}, if valid. Equivalent to calling create_ferret!(%{})

Creates a %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}

Updates a %Elixir.LazyContext.Examples.Animals.Schemas.Cat{} if it already exists, otherwise creates one

Updates a %Elixir.LazyContext.Examples.Animals.Schemas.Cat{} if it already exists, otherwise creates one

Updates a %Elixir.LazyContext.Examples.Animals.Schemas.Dog{} if it already exists, otherwise creates one

Updates a %Elixir.LazyContext.Examples.Animals.Schemas.Dog{} if it already exists, otherwise creates one

Updates a %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{} if it already exists, otherwise creates one

Updates a %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{} if it already exists, otherwise creates one

deletes a %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}

deletes a %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}

deletes a %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}

deletes a %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}

deletes a %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}

deletes a %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}

Gets a single %Elixir.LazyContext.Examples.Animals.Schemas.Cat{} where the primary key matches the given ID, with [:owner] preloaded

Gets a single %Elixir.LazyContext.Examples.Animals.Schemas.Cat{} where the primary key matches the given ID, with [:owner] preloaded

Gets a single %Elixir.LazyContext.Examples.Animals.Schemas.Dog{} where the primary key matches the given ID, with [:owner] preloaded

Gets a single %Elixir.LazyContext.Examples.Animals.Schemas.Dog{} where the primary key matches the given ID, with [:owner] preloaded

Gets a single %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{} where the primary key matches the given ID, with [:owner] preloaded

Gets a single %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{} where the primary key matches the given ID, with [:owner] preloaded

Returns a list of %Elixir.LazyContext.Examples.Animals.Schemas.Cat{} with [] preloaded

Returns a list of %Elixir.LazyContext.Examples.Animals.Schemas.Dog{} with [:owner] preloaded

Returns a list of %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{} with [:owner] preloaded

Updates a %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}

Updates a %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}

Updates a %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}

Updates a %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}

Updates a %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}

Updates a %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}

Link to this section Types

Link to this type cat() View Source
cat() :: %LazyContext.Examples.Animals.Schemas.Cat{
  __meta__: term(),
  colour: term(),
  cuteness: term(),
  id: term(),
  name: term(),
  owner: term(),
  owner_id: term()
}
Link to this type dog() View Source
dog() :: %LazyContext.Examples.Animals.Schemas.Dog{
  __meta__: term(),
  colour: term(),
  cuteness: term(),
  id: term(),
  name: term(),
  owner: term(),
  owner_id: term()
}
Link to this type ferret() View Source
ferret() :: %LazyContext.Examples.Animals.Schemas.Ferret{
  __meta__: term(),
  colour: term(),
  cuteness: term(),
  id: term(),
  name: term(),
  owner: term(),
  owner_id: term(),
  social_security_number: term()
}

Link to this section Functions

Link to this function change_cat(item, attrs \\ %{}) View Source
change_cat(cat(), map()) :: Ecto.Changeset.t()

Returns a data structure for tracking %Elixir.LazyContext.Examples.Animals.Schemas.Cat{} changes.

Examples

iex> change_cat(%Elixir.LazyContext.Examples.Animals.Schemas.Cat{}, %{field: value}) %Ecto.Changeset{}

generated via the LazyContext.__using__/1 macro.

Link to this function change_dog(item, attrs \\ %{}) View Source
change_dog(dog(), map()) :: Ecto.Changeset.t()

Returns a data structure for tracking %Elixir.LazyContext.Examples.Animals.Schemas.Dog{} changes.

Examples

iex> change_dog(%Elixir.LazyContext.Examples.Animals.Schemas.Dog{}, %{field: value}) %Ecto.Changeset{}

generated via the LazyContext.__using__/1 macro.

Link to this function change_ferret(item, attrs \\ %{}) View Source
change_ferret(ferret(), map()) :: Ecto.Changeset.t()

Returns a data structure for tracking %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{} changes.

Examples

iex> change_ferret(%Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}, %{field: value}) %Ecto.Changeset{}

generated via the LazyContext.__using__/1 macro.

Link to this function create_cat() View Source
create_cat() :: {:ok, cat()} | {:error, Ecto.Changeset.t()}

Creates an “empty” %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}, if valid. Equivalent to calling create_cat(%{})

Examples

iex> create_cat() {:ok, %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}}

generated via the LazyContext.__using__/1 macro.

Link to this function create_cat(attrs) View Source
create_cat(map()) :: {:ok, cat()} | {:error, Ecto.Changeset.t()}

Creates a %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}

Examples

iex> create_cat(%{field: value}) {:ok, %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}} iex> create_cat(%{field: bad_value}) {:error, %Ecto.Changeset{}}

generated via the LazyContext.__using__/1 macro.

Link to this function create_cat!() View Source
create_cat!() :: cat() | no_return()

Creates an “empty” %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}, if valid. Equivalent to calling create_cat!(%{})

Raises if the changeset is invalid.

Examples

iex> create_cat!() %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}

generated via the LazyContext.__using__/1 macro.

Link to this function create_cat!(attrs) View Source
create_cat!(map()) :: cat() | no_return()

Creates a %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}

Raises if the changeset is invalid.

Examples

iex> create_cat!(%{field: value}) %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}

generated via the LazyContext.__using__/1 macro.

Link to this function create_dog() View Source
create_dog() :: {:ok, dog()} | {:error, Ecto.Changeset.t()}

Creates an “empty” %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}, if valid. Equivalent to calling create_dog(%{})

Examples

iex> create_dog() {:ok, %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}}

generated via the LazyContext.__using__/1 macro.

Link to this function create_dog(attrs) View Source
create_dog(map()) :: {:ok, dog()} | {:error, Ecto.Changeset.t()}

Creates a %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}

Examples

iex> create_dog(%{field: value}) {:ok, %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}} iex> create_dog(%{field: bad_value}) {:error, %Ecto.Changeset{}}

generated via the LazyContext.__using__/1 macro.

Link to this function create_dog!() View Source
create_dog!() :: dog() | no_return()

Creates an “empty” %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}, if valid. Equivalent to calling create_dog!(%{})

Raises if the changeset is invalid.

Examples

iex> create_dog!() %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}

generated via the LazyContext.__using__/1 macro.

Link to this function create_dog!(attrs) View Source
create_dog!(map()) :: dog() | no_return()

Creates a %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}

Raises if the changeset is invalid.

Examples

iex> create_dog!(%{field: value}) %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}

generated via the LazyContext.__using__/1 macro.

Link to this function create_ferret() View Source
create_ferret() :: {:ok, ferret()} | {:error, Ecto.Changeset.t()}

Creates an “empty” %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}, if valid. Equivalent to calling create_ferret(%{})

Examples

iex> create_ferret() {:ok, %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}}

generated via the LazyContext.__using__/1 macro.

Link to this function create_ferret(attrs) View Source
create_ferret(map()) :: {:ok, ferret()} | {:error, Ecto.Changeset.t()}

Creates a %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}

Examples

iex> create_ferret(%{field: value}) {:ok, %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}} iex> create_ferret(%{field: bad_value}) {:error, %Ecto.Changeset{}}

generated via the LazyContext.__using__/1 macro.

Link to this function create_ferret!() View Source
create_ferret!() :: ferret() | no_return()

Creates an “empty” %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}, if valid. Equivalent to calling create_ferret!(%{})

Raises if the changeset is invalid.

Examples

iex> create_ferret!() %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}

generated via the LazyContext.__using__/1 macro.

Link to this function create_ferret!(attrs) View Source
create_ferret!(map()) :: ferret() | no_return()

Creates a %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}

Raises if the changeset is invalid.

Examples

iex> create_ferret!(%{field: value}) %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}

generated via the LazyContext.__using__/1 macro.

Link to this function create_or_update_cat(attrs) View Source
create_or_update_cat(map()) :: {:ok, cat()} | {:error, Ecto.Changeset.t()}

Updates a %Elixir.LazyContext.Examples.Animals.Schemas.Cat{} if it already exists, otherwise creates one.

Whether a %Elixir.LazyContext.Examples.Animals.Schemas.Cat{} already exists is determined by a lookup on the following fields: [:id]

Examples

iex> create_or_updatecat(%{field: value}) {:ok, %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}} iex> create_cat(%{field: bad_value}) {:error, %Ecto.Changeset{}}

generated via the LazyContext.__using__/1 macro.

Link to this function create_or_update_cat!(attrs) View Source
create_or_update_cat!(map()) :: cat() | no_return()

Updates a %Elixir.LazyContext.Examples.Animals.Schemas.Cat{} if it already exists, otherwise creates one.

Whether a %Elixir.LazyContext.Examples.Animals.Schemas.Cat{} already exists is determined by a lookup on the following fields: [:id]

Raises if the changeset is invalid

Examples

iex> create_or_updatecat!(%{field: value}) %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}

generated via the LazyContext.__using__/1 macro.

Link to this function create_or_update_dog(attrs) View Source
create_or_update_dog(map()) :: {:ok, dog()} | {:error, Ecto.Changeset.t()}

Updates a %Elixir.LazyContext.Examples.Animals.Schemas.Dog{} if it already exists, otherwise creates one.

Whether a %Elixir.LazyContext.Examples.Animals.Schemas.Dog{} already exists is determined by a lookup on the following fields: [:id]

Examples

iex> create_or_updatedog(%{field: value}) {:ok, %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}} iex> create_dog(%{field: bad_value}) {:error, %Ecto.Changeset{}}

generated via the LazyContext.__using__/1 macro.

Link to this function create_or_update_dog!(attrs) View Source
create_or_update_dog!(map()) :: dog() | no_return()

Updates a %Elixir.LazyContext.Examples.Animals.Schemas.Dog{} if it already exists, otherwise creates one.

Whether a %Elixir.LazyContext.Examples.Animals.Schemas.Dog{} already exists is determined by a lookup on the following fields: [:id]

Raises if the changeset is invalid

Examples

iex> create_or_updatedog!(%{field: value}) %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}

generated via the LazyContext.__using__/1 macro.

Link to this function create_or_update_ferret(attrs) View Source
create_or_update_ferret(map()) ::
  {:ok, ferret()} | {:error, Ecto.Changeset.t()}

Updates a %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{} if it already exists, otherwise creates one.

Whether a %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{} already exists is determined by a lookup on the following fields: [:social_security_number]

Examples

iex> create_or_updateferret(%{field: value}) {:ok, %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}} iex> create_ferret(%{field: bad_value}) {:error, %Ecto.Changeset{}}

generated via the LazyContext.__using__/1 macro.

Link to this function create_or_update_ferret!(attrs) View Source
create_or_update_ferret!(map()) :: ferret() | no_return()

Updates a %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{} if it already exists, otherwise creates one.

Whether a %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{} already exists is determined by a lookup on the following fields: [:social_security_number]

Raises if the changeset is invalid

Examples

iex> create_or_updateferret!(%{field: value}) %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}

generated via the LazyContext.__using__/1 macro.

Link to this function delete_cat(item) View Source
delete_cat(cat()) :: {:ok, cat()} | {:error, Ecto.Changeset.t()}

deletes a %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}

Examples

iex> delete_cat(%Elixir.LazyContext.Examples.Animals.Schemas.Cat{}) {:ok, %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}} iex> delete_cat(%Elixir.LazyContext.Examples.Animals.Schemas.Cat{}) {:error, %Ecto.Changeset{}}

generated via the LazyContext.__using__/1 macro.

Link to this function delete_cat!(item) View Source
delete_cat!(cat()) :: :cat | no_return()

deletes a %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}

Raises if deletion fails

Examples

iex> delete_cat!(%Elixir.LazyContext.Examples.Animals.Schemas.Cat{}) %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}

generated via the LazyContext.__using__/1 macro.

Link to this function delete_dog(item) View Source
delete_dog(dog()) :: {:ok, dog()} | {:error, Ecto.Changeset.t()}

deletes a %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}

Examples

iex> delete_dog(%Elixir.LazyContext.Examples.Animals.Schemas.Dog{}) {:ok, %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}} iex> delete_dog(%Elixir.LazyContext.Examples.Animals.Schemas.Dog{}) {:error, %Ecto.Changeset{}}

generated via the LazyContext.__using__/1 macro.

Link to this function delete_dog!(item) View Source
delete_dog!(dog()) :: :dog | no_return()

deletes a %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}

Raises if deletion fails

Examples

iex> delete_dog!(%Elixir.LazyContext.Examples.Animals.Schemas.Dog{}) %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}

generated via the LazyContext.__using__/1 macro.

Link to this function delete_ferret(item) View Source
delete_ferret(ferret()) :: {:ok, ferret()} | {:error, Ecto.Changeset.t()}

deletes a %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}

Examples

iex> delete_ferret(%Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}) {:ok, %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}} iex> delete_ferret(%Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}) {:error, %Ecto.Changeset{}}

generated via the LazyContext.__using__/1 macro.

Link to this function delete_ferret!(item) View Source
delete_ferret!(ferret()) :: :ferret | no_return()

deletes a %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}

Raises if deletion fails

Examples

iex> delete_ferret!(%Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}) %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}

generated via the LazyContext.__using__/1 macro.

Link to this function get_cat(attrs) View Source
get_cat(map()) :: [cat()] | nil
get_cat(integer()) :: [cat()] | nil

Gets a single %Elixir.LazyContext.Examples.Animals.Schemas.Cat{} where the primary key matches the given ID, with [:owner] preloaded.

Returns nil if no result was found. Raises if more than one result was found.

Examples

iex> get_cat(123)
%Elixir.LazyContext.Examples.Animals.Schemas.Cat{}

generated via the LazyContext.__using__/1 macro.

Link to this function get_cat!(attrs) View Source
get_cat!(map()) :: [cat()] | no_return()
get_cat!(integer()) :: [cat()] | no_return()

Gets a single %Elixir.LazyContext.Examples.Animals.Schemas.Cat{} where the primary key matches the given ID, with [:owner] preloaded.

Raises if no result, or more than one result was found.

Examples

iex> get_cat(123)
%Elixir.LazyContext.Examples.Animals.Schemas.Cat{}

generated via the LazyContext.__using__/1 macro.

Link to this function get_dog(attrs) View Source
get_dog(map()) :: [dog()] | nil
get_dog(integer()) :: [dog()] | nil

Gets a single %Elixir.LazyContext.Examples.Animals.Schemas.Dog{} where the primary key matches the given ID, with [:owner] preloaded.

Returns nil if no result was found. Raises if more than one result was found.

Examples

iex> get_dog(123)
%Elixir.LazyContext.Examples.Animals.Schemas.Dog{}

generated via the LazyContext.__using__/1 macro.

Link to this function get_dog!(attrs) View Source
get_dog!(map()) :: [dog()] | no_return()
get_dog!(integer()) :: [dog()] | no_return()

Gets a single %Elixir.LazyContext.Examples.Animals.Schemas.Dog{} where the primary key matches the given ID, with [:owner] preloaded.

Raises if no result, or more than one result was found.

Examples

iex> get_dog(123)
%Elixir.LazyContext.Examples.Animals.Schemas.Dog{}

generated via the LazyContext.__using__/1 macro.

Link to this function get_ferret(attrs) View Source
get_ferret(map()) :: [ferret()] | nil
get_ferret(integer()) :: [ferret()] | nil

Gets a single %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{} where the primary key matches the given ID, with [:owner] preloaded.

Returns nil if no result was found. Raises if more than one result was found.

Examples

iex> get_ferret(123)
%Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}

generated via the LazyContext.__using__/1 macro.

Link to this function get_ferret!(attrs) View Source
get_ferret!(map()) :: [ferret()] | no_return()
get_ferret!(integer()) :: [ferret()] | no_return()

Gets a single %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{} where the primary key matches the given ID, with [:owner] preloaded.

Raises if no result, or more than one result was found.

Examples

iex> get_ferret(123)
%Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}

generated via the LazyContext.__using__/1 macro.

Link to this function list_cats() View Source
list_cats() :: [cat()]

Returns a list of %Elixir.LazyContext.Examples.Animals.Schemas.Cat{} with [] preloaded.

Examples

iex> list_cats()
[%Elixir.LazyContext.Examples.Animals.Schemas.Cat{}, ...]

generated via the LazyContext.__using__/1 macro.

Link to this function list_doggos() View Source
list_doggos() :: [dog()]

Returns a list of %Elixir.LazyContext.Examples.Animals.Schemas.Dog{} with [:owner] preloaded.

Examples

iex> list_doggos()
[%Elixir.LazyContext.Examples.Animals.Schemas.Dog{}, ...]

generated via the LazyContext.__using__/1 macro.

Link to this function list_ferrets() View Source
list_ferrets() :: [ferret()]

Returns a list of %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{} with [:owner] preloaded.

Examples

iex> list_ferrets()
[%Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}, ...]

generated via the LazyContext.__using__/1 macro.

Link to this function update_cat(item, attrs) View Source
update_cat(cat(), map()) :: {:ok, cat()} | {:error, Ecto.Changeset.t()}

Updates a %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}

Examples

iex> update_cat(%Elixir.LazyContext.Examples.Animals.Schemas.Cat{}, %{field: value}) {:ok, %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}} iex> update_cat(%Elixir.LazyContext.Examples.Animals.Schemas.Cat{}, %{field: bad_value}) {:error, %Ecto.Changeset{}}

generated via the LazyContext.__using__/1 macro.

Link to this function update_cat!(item, attrs) View Source
update_cat!(cat(), map()) :: cat() | no_return()

Updates a %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}

Raises if the changeset is invalid

Examples

iex> update_cat!(%Elixir.LazyContext.Examples.Animals.Schemas.Cat{}, %{field: value}) %Elixir.LazyContext.Examples.Animals.Schemas.Cat{}

generated via the LazyContext.__using__/1 macro.

Link to this function update_dog(item, attrs) View Source
update_dog(dog(), map()) :: {:ok, dog()} | {:error, Ecto.Changeset.t()}

Updates a %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}

Examples

iex> update_dog(%Elixir.LazyContext.Examples.Animals.Schemas.Dog{}, %{field: value}) {:ok, %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}} iex> update_dog(%Elixir.LazyContext.Examples.Animals.Schemas.Dog{}, %{field: bad_value}) {:error, %Ecto.Changeset{}}

generated via the LazyContext.__using__/1 macro.

Link to this function update_dog!(item, attrs) View Source
update_dog!(dog(), map()) :: dog() | no_return()

Updates a %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}

Raises if the changeset is invalid

Examples

iex> update_dog!(%Elixir.LazyContext.Examples.Animals.Schemas.Dog{}, %{field: value}) %Elixir.LazyContext.Examples.Animals.Schemas.Dog{}

generated via the LazyContext.__using__/1 macro.

Link to this function update_ferret(item, attrs) View Source
update_ferret(ferret(), map()) ::
  {:ok, ferret()} | {:error, Ecto.Changeset.t()}

Updates a %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}

Examples

iex> update_ferret(%Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}, %{field: value}) {:ok, %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}} iex> update_ferret(%Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}, %{field: bad_value}) {:error, %Ecto.Changeset{}}

generated via the LazyContext.__using__/1 macro.

Link to this function update_ferret!(item, attrs) View Source
update_ferret!(ferret(), map()) :: ferret() | no_return()

Updates a %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}

Raises if the changeset is invalid

Examples

iex> update_ferret!(%Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}, %{field: value}) %Elixir.LazyContext.Examples.Animals.Schemas.Ferret{}

generated via the LazyContext.__using__/1 macro.