Boruta.Ecto.Admin.Clients (Boruta core v1.2.0) View Source

Boruta.Ecto.Client resource administration.

Link to this section Summary

Functions

Creates a client.

Deletes a Client.

Gets a single client.

Returns the list of clients.

Updates a client.

Link to this section Functions

Link to this function

create_client(attrs \\ %{})

View Source

Creates a client.

Examples

iex> create_client(%{field: value})
{:ok, %Client{}}

iex> create_client(%{field: bad_value})
{:error, %Ecto.Changeset{}}

Deletes a Client.

Examples

iex> delete_client(client)
{:ok, %Client{}}

iex> delete_client(client)
{:error, %Ecto.Changeset{}}

Gets a single client.

Raises Ecto.NoResultsError if the Client does not exist.

Examples

iex> get_client!(123)
%Client{}

iex> get_client!(456)
** (Ecto.NoResultsError)

Returns the list of clients.

Examples

iex> list_clients()
[%Client{}, ...]
Link to this function

update_client(client, attrs)

View Source

Updates a client.

Examples

iex> update_client(client, %{field: new_value})
{:ok, %Client{}}

iex> update_client(client, %{field: bad_value})
{:error, %Ecto.Changeset{}}