Search, Sort and Pagination for ecto queries
Change in namespace/module names:
Rummage.Ecto.Hooks
with Rummage.Ecto.Hook
.Rummage.Ecto.CustomHooks
with Rummage.Ecto.CustomHook
.Introducing Rummage.Ecto.Schema
:
Changes to Rummage.Ecto.Hook.Search
:
Changes to Rummage.Ecto.Hook.Sort
:
Changes to Rummage.Ecto.Hook.Paginate
:
Changes in Configurations:
This Release has ways to abstract and override schema/rummage functionalities.
Better Behaviour definition for Hooks.
__using__
macro, instead of using module_attribute @behviour
.run/2
and format_params
,defoverridable
for @behaviour
callbacks.Make Native hooks more generalized instead of targeted for phoenix
.
atoms
over strings
for keys in maps and params.The return of Rummage.Ecto.__using__/1
macro.
rummage_ecto
to resolve configurations at compile time.Rummage.Ecto
.App specific configurations.
config :appname, Rummage.Ecto .....
instead of config: :rummage_ecto, Rummage.Ecto
.__using__
macro, based on the application the module belongs to.Search hook has search_expr
.
or_where
and not_where
queries.where
.Search hook has search_type
: is_null
NULL
or NOT NULL
Tested/Examples with different field_types
, boolean
, float
, string
etc.
Paginate hook works with or without a primary_key
:
id
as primary keys, now it works for all and even Schemas without a primary key.Keyset Pagination CustomHook.
SimpleSort and SimpleSearch CustomHook updates.
Better documentation.
This release is to illustrate the actual behavior of Rummage, which is functional:
EctoSchema.rummage(query, rummage)
, call Rummage.Ecto.rummage(query, rummage)
Default Hooks
can handle any number of associations.
Hooks
are more independent of each other due to a newly introduced before_hook
feature. This
allows us to format rummage_params
based on what a hook is expecting and keep the code clean.CustomHook
with key-set
pagination based on this link.Has Rummage.Phoenix support
Fully configurable. The hooks are independent, yet work well on top of each other.