-
Bumps
- elixir version 1.13
- dependencies versions
-
Fix credo issues
-
Change in namespace/module names:
- Replace
Rummage.Ecto.Hooks
withRummage.Ecto.Hook
. - Replace
Rummage.Ecto.CustomHooks
withRummage.Ecto.CustomHook
.
- Replace
-
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:
-
Better Behaviour definition for Hooks.
- Add
__using__
macro, instead of using module_attribute@behviour
. - Use better function names
run/2
andformat_params
, - Use
defoverridable
for@behaviour
callbacks.
- Add
-
Make Native hooks more generalized instead of targeted for
phoenix
.- Use
atoms
overstrings
for keys in maps and params. - Keep hooks more agnostic of configurations.
- Make Rummage.Ecto delegate configurations to hooks.
- Use
-
The return of
Rummage.Ecto.__using__/1
macro.- This allows
rummage_ecto
to resolve configurations at compile time. - This allows better/easier usage of
Rummage.Ecto
.
- This allows
-
App specific configurations.
config :appname, Rummage.Ecto .....
instead ofconfig: :rummage_ecto, Rummage.Ecto
.- This allows using rummage with two different apps in an umbrella app with different rummage configurations.
- These configurations are loaded with the help of
__using__
macro, based on the application the module belongs to.
-
Search hook has
search_expr
.- This allows usage of
or_where
andnot_where
queries. - Defaults to
where
.
- This allows usage of
-
Search hook has
search_type
:is_nil
- This allows for searching for
NULL
orNOT NULL
- This allows for searching for
-
Tested/Examples with different
field_types
,boolean
,float
,string
etc. -
Paginate hook works with or without a
primary_key
:- the default paginate hook used to work only for Schemas with
id
as primary keys, now it works for all and even Schemas without a primary key.
- the default paginate hook used to work only for Schemas with
-
Keyset Pagination CustomHook.
- Adds faster/lighter weight pagination option.
- Documentation specifies when to use it and when not to.
-
SimpleSort and SimpleSearch CustomHook updates.
- Same as sort and search, but without associations, so cleaner and faster.
-
Better documentation.
- Search and Sort associations are better documented.
- CustomHooks are better documented.
- Faster Pagination Hooks
-
More functional way of calling
Rummage
:- Instead of
EctoSchema.rummage(query, rummage)
, callRummage.Ecto.rummage(query, rummage)
- Instead of
-
Default
Hooks
can handle any number of associations.
Hooks
are more independent of each other due to a newly introducedbefore_hook
feature. This allows us to formatrummage_params
based on what a hook is expecting and keep the code clean.
- A
CustomHook
withkey-set
pagination based on this link.
-
Search
:- Can now search more than just
like
. - Added case insensitive
like
feature. - Added support for
like
,ilike
,eq
,gt
,lt
,gteq
,lteq
assearch_types
(Refer to docs for more details) - Can search on an association field (Refer to docs for more details)
- Can now search more than just
-
Sort
:- Added case insensitive
sort
. - Can sort on an association field (Refer to docs for more details)
- Added case insensitive
-
Pagination
: NO CHANGES
-
search
key:-
Earlier:
rummage = %{"search" => %{"field_1" => "field_!"}}
-
Now:
rummage = %{"search" => %{"field_1" => %{"assoc" => ["assoc_1", "assoc_2"], "search_type" => "like", "search_term" => "field_!"}}
-
-
sort
key:- Earlier:
rummage = %{"sort" => "field_1.asc"}
- Now: ```elixir rummage = %{"sort" => %{"assoc" => ["assoc_1", "assoc_2"], "field" => "field_1.asc"}}
- Earlier:
-
paginate
key: NO CHANGES
- Included some examples for custom hooks:
Rumamage.Ecto.CustomHooks.SimpleSearch
: Vanilla search feature with support for onlylike
Rumamage.Ecto.CustomHooks.SimpleSort
: Vanilla sort feature
- First version with Rummage.Phoenix compatibility
- First major version