code_corps v0.0.1 CodeCorps.Helpers.Query View Source
Link to this section Summary
Functions
Applies optional filters by key-value to query dynamically
Link to this section Functions
Link to this function
id_filter(query, id_list)
View Source
id_filter(Ecto.Queryable.t(), map() | String.t()) :: Ecto.Queryable.t()
Link to this function
optional_filters(query, params, list)
View Source
optional_filters(Ecto.Queryable.t(), map(), list()) :: Ecto.Queryable.t()
Applies optional filters by key-value to query dynamically.
Used by piping a queryable with a map of parameters and a list of keys to filter by.
For each key in the list, the params map has a value for that key,
the query condition for that {key, value} is applied to the queriable.