Flop.validate_and_run
You're seeing just the function
validate_and_run
, go back to Flop module for more information.
Specs
validate_and_run(Ecto.Queryable.t(), map() | t(), [option()]) :: {:ok, {[any()], Flop.Meta.t()}} | {:error, Ecto.Changeset.t()}
Validates the given flop parameters and retrieves the data and meta data on success.
iex> {:ok, {[], %Flop.Meta{}}} =
...> Flop.validate_and_run(Flop.Pet, %Flop{}, for: Flop.Pet)
iex> {:error, %Ecto.Changeset{} = changeset} =
...> Flop.validate_and_run(Flop.Pet, %Flop{limit: -1})
iex> changeset.errors
[
limit: {"must be greater than %{number}",
[validation: :number, kind: :greater_than, number: 0]}
]
Options
for
: Passed toFlop.validate/2
.repo
: TheEcto.Repo
module. Required if no default repo is configured.get_cursor_value_func
: An arity-2 function to be used to retrieve an unencoded cursor value from a query result item and theorder_by
fields. Defaults toFlop.Cursor.get_cursor_from_node/2
.