Filtrex v0.1.0 Filtrex
Filtrex consists of three primary components:
Filtrex
- handles the overall parsing of filters and delegates toFiltrex.AST
to build an ecto query expressionFiltrex.Condition
- an abstract module built to delegate to specific condition modules in the format ofFiltrex.Condition.Type
where the type is converted to CamelCase (SeeFiltrex.Condition.Text.parse/2
)Filtrex.Fragment
- simple struct to hold generated expressions and values to be used when generating queries for ecto
Summary
Functions
Parses a filter expression and returns errors or the parsed filter with the appropriate parsed sub-structures
Converts a filter with the specified ecto module name into a valid ecto query expression that is compiled when called
Types
Functions
Parses a filter expression and returns errors or the parsed filter with the appropriate parsed sub-structures.
The config
option is a map of the acceptable types and the configuration
options to pass to each condition type.
Example:
%{
text: %{keys: ~w(title comments)}
}
Specs
query(Filter.t, module, Macro.Env.t) :: Ecto.Query.t
Converts a filter with the specified ecto module name into a valid ecto query expression that is compiled when called.