woylie
Flop - Filtering, sorting and pagination for Ecto
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries.
- offset-based pagination with
offset/limitorpage/page_size - cursor-based pagination
- sorting
- filtering
- parameter validation
- configurable filterable and sortable fields
- join fields
- compound fields
- query and meta data helpers
- Relay connection formatter (edges, nodes and page info)
- UI helpers and URL builders through Flop Phoenix.
Most Liked
maltoe
My company has early-adopted Flop & Flop.Phoenix in May 2021 and we have been using it for admin dashboards in multiple apps since, in production environments. We especially love the sweetspot position Flop.Phoenix takes between “being a logic-less table component” and a full-blown UI generator, giving us enough out-of-the-box functionality while allowing for easy customization. It’s been working like a charm and @woylie has been very generously devoting time to the issues we’ve raised and ideas we had.
Sounds a bit like an advertisement ^^
What I’m trying to say is: This pair of libraries deserves a lot more attention.
Thank you @woylie for all the work ![]()
woylie
Flop 0.19 comes with custom fields, a new helper for dynamically adding bindings, and a set of filter manipulation functions.
Added
- Support for custom fields. These fields allow you to run custom filter
functions for anything that cannot be expressed with Flop filters. - Added
Flop.with_named_bindings/4for dynamically adding bindings needed for
a Flop query. - Added
fetch,get,get_all,delete,delete_first,drop,new,
take,pop,pop_first,putandput_newfunctions toFlop.Filter. - Added
Flop.Meta.with_errors/3. - Added
ecto_typeoption to join fields. - Added
not_likeandnot_ilikefilter operators. - Added a cheatsheet for schema configuration.
Changed
- Renamed
Flop.bindings/3toFlop.named_bindings/3. Flop.Filter.allowed_operators/2now tries to determine the Ecto type by
reading the Flop field type from the schema module. This function is used
during parameter validation, which means the validation step will be a bit
stricter now. For join and custom fields, the Ecto type is determined via the
newecto_typeoption. If the option is not set, the function returns all
operators as before. For compound fields, only the supported operators are
returned.- Added
optsfield toFlop.Metastruct.
woylie
That is already implemented! You can choose between offset-based and cursor-based pagination. See also:
Flop.Phoenix has two different UI components for offset-based and cursor-based pagination.
Popular in Announcing
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









