Skip to content

0.16.0

Compare
Choose a tag to compare
@woylie woylie released this 22 Mar 00:02
· 643 commits to main since this release
f6df0a6

Added

  • You can now define a configuration module with use Flop to set defaults
    instead of or in addition to the application configuration. This makes it
    easier to work with multiple Ecto repos.
  • The new function Flop.bindings/3 returns the necessary bindings for a
    given Flop query. You can use it in case you want to optimize your queries by
    only joining tables that are actually needed.
  • Added a count_query option to override the count query used by
    Flop.run/3, Flop.validate_and_run/3 and Flop.validate_and_run!/3.
  • You can get a list of allowed operators for a given Ecto type or a given
    schema field with Flop.Filter.allowed_operators/1 and
    Flop.Filter.allowed_operators/2 now.

Changed

  • Breaking: The :empty and :not_empty filters now require a boolean value.
    If no value is passed, the filter is ignored, just as it is handled for all
    other filter operators. This change was necessary to make the integration
    with filter forms (checkboxes) easier.
  • Breaking: The default order needs to be passed as a map now when deriving
    Flop.Schema. The previous implementation already converted the two separate
    configuration keys to a map. This meant that the configuration passed when
    deriving Flop.Schema had a different format from the one you had to pass
    when overriding the default order with the opts.
    With this change, the configuration format is the same everywhere. A compile
    time exception is raised if you are still using the old format, guiding you in
    the update.
  • It is now validated that the filter operator matches the field type.
  • The compile time validation of the options passed when deriving Flop.Schema
    has been improved.
  • Allow passing page as string to Flop.set_page/2.
  • Allow passing offset as string to Flop.set_offset/2.