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 http://use-the-index-luke.com/no-offset
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!








