forage v0.2.0 Forage.Codec.Decoder

Functionality to decode a Phoenix params map into a form suitable for use with the query builders and pagination libraries

Link to this section Summary

Functions

Encodes a params map into a forage plan (Forage.ForagerPlan)

Extract and decode the pagination data from the params map into a keyword list

Extract and decode the search filters from the params map into a list of filters

Extract and decode the sort fields from the params map into a keyword list

Link to this section Types

Link to this type assoc()
assoc() :: {schema(), atom(), atom()}
Link to this type schema()
schema() :: atom()

Link to this section Functions

Link to this function decode(params, schema)

Encodes a params map into a forage plan (Forage.ForagerPlan).

Link to this function decode_field_or_assoc(field_string, schema)
Link to this function decode_pagination(arg1, schema)

Extract and decode the pagination data from the params map into a keyword list.

Link to this function decode_search(arg1, schema)

Extract and decode the search filters from the params map into a list of filters.

Link to this function decode_sort(arg1, schema)

Extract and decode the sort fields from the params map into a keyword list.

Link to this function pagination_data_to_integer!(value)
Link to this function remote_schema(local_name, local_schema)
Link to this function safe_field_names_to_assoc!(local_name, remote_name, local_schema)
safe_field_names_to_assoc!(String.t(), String.t(), atom()) :: assoc()