aditya7iyengar
Rummage.Ecto - Searching, Sorting and Pagination in Ecto & Phoenix
Rummage.Ecto and Rummage.Phoenix provide ways to perform Searching, Sorting and Pagination over Ecto queries and Phoenix collections.
For more details visit this blog
Here’s a little demo:

Most Liked
brightball
Does it account for We need tool support for keyset pagination
michalmuskala
This looks like a great project - it has several issues, though (I’m speaking only about the ecto part - haven’t looked at others yet).
It injects a lot of code and functions inside __using__/1 - it is considered a bad practice. This leads to multiple issues - including slower compilation and inferior debugging experience.
It also couples schema to the repo module, which is something ecto actively avoids.
As an alternative, I could easily imagine a pure function-based interface, for example:
Rummage.Ecto.paginate(query, MyApp.Repo)
# instead of
MySchema.rummage(query)
The schema can be easily extracted from the query:
query = Ecto.Queryable.to_query(query)
{_source, schema} = query.from
One thing to note, though is that the schema can be nil, since it’s not required, but I also don’t see really a reason why it would be needed.
aditya7iyengar
That’s a great suggestion! It will be great to not have a lot of code in __using__/1. I guess I have some work to do over this week. Thanks for your input!
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
- #performance








