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
@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)
@spec set_anonymized(Ecto.Repo.t(), struct()) :: {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}