View Source EctoAnon.Query (ecto_anon v0.4.0)

Link to this section Summary

Functions

Returns a query that searches resources excluding anonymized ones

Link to this section Functions

Link to this function

apply(data, repo, struct)

View Source
@spec apply(%{fields: List.t(), embeds: List.t()}, Ecto.Repo.t(), struct()) ::
  {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}
@spec apply(keyword(), Ecto.Repo.t(), struct()) ::
  {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}
@spec not_anonymized(Ecto.Queryable.t()) :: Ecto.Queryable.t()

Returns a query that searches resources excluding anonymized ones

query = from(u in User, select: u)
|> not_anonymized

results = Repo.all(query)
Link to this function

set_anonymized(repo, struct)

View Source
@spec set_anonymized(Ecto.Repo.t(), struct()) ::
  {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}