Baz.Collections (baz v0.0.16)
Link to this section Summary
Link to this section Types
Link to this type
collection()
@type collection() :: Baz.Collections.Collection.t()
Link to this type
create_attrs()
@type create_attrs() :: map()
Link to this type
filter_and_order_opts()
Link to this type
order_opt()
@type order_opt() :: {:order, [atom()]}
Link to this type
where_opt()
Link to this section Functions
Link to this function
collection_changeset(attrs)
@spec collection_changeset(map()) :: Ecto.Changeset.t() | {:error, term()}
Link to this function
create_collection(attrs)
@spec create_collection(create_attrs()) :: {:ok, collection()} | {:error, term()}
Link to this function
delete_collection(collection)
Deletes a collection.
examples
Examples
iex> delete_collection(collection)
{:ok, %Collection{}}
iex> delete_collection(collection)
{:error, %Ecto.Changeset{}}
Link to this function
filter_and_order(opts)
@spec filter_and_order(filter_and_order_opts()) :: [collection()]
Link to this function
get_collection!(id)
@spec get_collection!(term()) :: collection()
Gets a single collection.
Raises Ecto.NoResultsError
if the Collection does not exist.
examples
Examples
iex> get_collection!(123)
%Collection{}
iex> get_collection!(456)
** (Ecto.NoResultsError)