Add async forms for all and where methods for a chain.
It'll add a possibility to use not only findAsync method at the end of the chan calls but whereAsync and allAsync. From the example below, all queries will generate the same conditions:
Person.find({ name: 'John' }).where('age >= ? OR age =< ?', [18, 20]).findAsync();
Person.find({ name: 'John' }).where('age >= ? OR age =< ?', [18, 20]).allAsync();
Person.find({ name: 'John' }).where('age >= ? OR age =< ?', [18, 20]).whereAsync();
These changes also will fix the example from readme page:
Person.find({ age: 18 }).where("LOWER(surname) LIKE ?", ['dea%']).allAsync( ... );
As allAsync will be called from model level.
Realizations of find methods in the model and in the chain are different. Do we really need to keep them in separate places?
Add async forms for
all
andwhere
methods for a chain.It'll add a possibility to use not only
findAsync
method at the end of the chan calls butwhereAsync
andallAsync
. From the example below, all queries will generate the same conditions:These changes also will fix the example from readme page:
As
allAsync
will be called from model level.Realizations of
find
methods in the model and in the chain are different. Do we really need to keep them in separate places?