[sequelize] Add the "nested" property to IncludeOptions interface

This commit is contained in:
thomas-b
2018-06-07 15:19:08 +02:00
parent 9fb84d20ac
commit b969b084d1
2 changed files with 7 additions and 0 deletions
+6
View File
@@ -13,6 +13,7 @@
// Florian Oellerich <https://github.com/Raigen>
// Todd Bealmear <https://github.com/todd>
// Nick Schultz <https://github.com/nrschultz>
// Thomas Breleur <https://github.com/thomas-b>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -3270,6 +3271,11 @@ declare namespace sequelize {
paranoid?: boolean;
all?: boolean | string;
/**
* if true, it will also eager load the relations of the child models, recursively.
*/
nested?: boolean;
}
/**
+1
View File
@@ -933,6 +933,7 @@ User.findAll( { include : [{ all : 'HasMany', attributes : ['name'] }] } );
User.findAll( { include : [{ all : true }, { model : User, attributes : ['id'] }] } );
User.findAll( { include : [{ all : 'BelongsTo' }] } );
User.findAll( { include : [{ all : true }] } );
User.findAll( { include : [{ nested : true }] } );
User.findAll( { where : { username : 'barfooz' }, raw : true } );
User.findAll( { where : { name : 'worker' }, include : [{ model : User, as : 'ToDos' }] } );
User.findAll( { where : { user_id : 1 }, attributes : ['a', 'b'], include : [{ model : User, attributes : ['c'] }] } );