mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 20:21:46 +00:00
fix Sequelize.FindOptions to be able use functions as attributes and make grouping. (#9485)
This commit is contained in:
committed by
Masahiro Wakame
parent
8daa4ef04a
commit
6d61dabe67
@@ -888,6 +888,10 @@ User.findAll( { include : [User], order : [['id', 'ASC NULLS LAST'], [User, 'id'
|
||||
User.findAll( { include : [{ model : User, where : { title : 'DoDat' }, include : [{ model : User }] }] } );
|
||||
User.findAll( { attributes: ['username', 'data']});
|
||||
User.findAll( { attributes: {include: ['username', 'data']} });
|
||||
User.findAll( { attributes: [['username', 'UNM'], ['email', 'EML']] });
|
||||
User.findAll( { attributes: [s.fn('count', Sequelize.col('*'))] });
|
||||
User.findAll( { attributes: [[s.fn('count', Sequelize.col('*')), 'count']] });
|
||||
User.findAll( { attributes: [[s.fn('count', Sequelize.col('*')), 'count']], group: ['sex'] });
|
||||
|
||||
User.findById( 'a string' );
|
||||
|
||||
|
||||
Vendored
+8
-2
@@ -3133,7 +3133,7 @@ declare module "sequelize" {
|
||||
* `Sequelize.literal`, `Sequelize.fn` and so on), and the second is the name you want the attribute to
|
||||
* have in the returned instance
|
||||
*/
|
||||
attributes? : Array<string> | { include?: Array<string>, exclude?: Array<string> };
|
||||
attributes?: Array<string | fn | [string, string] | [fn, string]> | { include?: Array<string>, exclude?: Array<string> };
|
||||
|
||||
/**
|
||||
* If true, only non-deleted records will be returned. If false, both deleted and non-deleted records will
|
||||
@@ -3194,6 +3194,12 @@ declare module "sequelize" {
|
||||
*/
|
||||
having? : WhereOptions;
|
||||
|
||||
/**
|
||||
* Group by. It is not mentioned in sequelize's JSDoc, but mentioned in docs.
|
||||
* https://github.com/sequelize/sequelize/blob/master/docs/docs/models-usage.md#user-content-manipulating-the-dataset-with-limit-offset-order-and-group
|
||||
*/
|
||||
group?: string | string[] | Object;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -6186,4 +6192,4 @@ declare module "sequelize" {
|
||||
|
||||
export = sequelize;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user