Filtrex v0.1.0 API Reference

Modules

Filtrex consists of three primary components

Filtrex.AST is a helper for building out the ecto macro query expression from a set of conditions. Typically, it shouldn’t need to be called direcly

Filtrex.Condition is an abstract module for parsing conditions

Filtrex.Condition.Date is a specific condition type for handling date filters with various comparisons

Filtrex.Condition.Text is a specific condition type for handling text filters with various comparisons

Filtrex.Fragment is a simple struct used to hold an expression and values. It is used by Filter.Encoder.encode/1 to turn conditions into ecto queries. Example:

%Filtrex.Fragment{expression: "(text = ?)", values: ["Buy Milk"]}

Protocols

Encodes a condition into Filtrex.Fragment as an expression with values