BoxTurtle.Schema.Query.Options.API behaviour (BoxTurtle v0.1.0)

Copy Markdown View Source

Accessors for the settings given to use BoxTurtle.Schema.Query.

Every accessor takes an optional keyword list; a value for the same key in it overrides the use-time setting. This is how call-time options such as repo: or default_sort: take effect.

Summary

Callbacks

default_distinct()

@callback default_distinct() :: [atom()]

default_distinct(keyword)

@callback default_distinct(keyword()) :: [atom()]

default_preloads()

@callback default_preloads() :: list()

default_preloads(keyword)

@callback default_preloads(keyword()) :: list()

default_sort()

@callback default_sort() :: BoxTurtle.Schema.Sort.API.sort_spec()

default_sort(keyword)

@callback default_sort(keyword()) :: BoxTurtle.Schema.Sort.API.sort_spec()

filter_module()

@callback filter_module() :: module()

filter_module(keyword)

@callback filter_module(keyword()) :: module()

inject_query_options(keyword)

@callback inject_query_options(keyword()) :: keyword()

Adds every use-time setting to the given options, keeping any value already present in them.

page_size()

@callback page_size() :: pos_integer()

page_size(keyword)

@callback page_size(keyword()) :: pos_integer()

primary_key()

@callback primary_key() :: atom()

primary_key(keyword)

@callback primary_key(keyword()) :: atom()

repo()

@callback repo() :: module()

repo(keyword)

@callback repo(keyword()) :: module()

schema()

@callback schema() :: module()

schema(keyword)

@callback schema(keyword()) :: module()

sorting_module()

@callback sorting_module() :: module()

sorting_module(keyword)

@callback sorting_module(keyword()) :: module()