Integrate.Accounts (IntegrateDB v0.1.0) View Source
The Accounts context.
Link to this section Summary
Functions
Returns a boolean indicating whether any users exist.
Returns an %Ecto.Changeset{}
for tracking user changes.
Creates a user.
Deletes a user.
Gets a single user.
Gets a single user.
Returns the list of users.
Updates a user.
Link to this section Functions
Returns a boolean indicating whether any users exist.
Examples
iex> any_users_exist?()
true
Returns an %Ecto.Changeset{}
for tracking user changes.
Examples
iex> change_user(user)
%Ecto.Changeset{data: %User{}}
Creates a user.
Examples
iex> create_user(%{field: value})
{:ok, %User{}}
iex> create_user(%{field: bad_value})
{:error, %Ecto.Changeset{}}
Deletes a user.
Examples
iex> delete_user(user)
{:ok, %User{}}
iex> delete_user(user)
{:error, %Ecto.Changeset{}}
Gets a single user.
Returns nil
if the User does not exist.
Examples
iex> get_user!(123)
%User{}
iex> get_user!(456)
nil
Gets a single user.
Raises Ecto.NoResultsError
if the User does not exist.
Examples
iex> get_user!(123)
%User{}
iex> get_user!(456)
** (Ecto.NoResultsError)
Returns the list of users.
Examples
iex> list_users()
[%User{}, ...]
Updates a user.
Examples
iex> update_user(user, %{field: new_value})
{:ok, %User{}}
iex> update_user(user, %{field: bad_value})
{:error, %Ecto.Changeset{}}