diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index be89371b83..47eb708e25 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -3171,7 +3171,6 @@ declare namespace sequelize { * be returned. Only applies if `options.paranoid` is true for the model. */ paranoid?: boolean; - } /** @@ -3244,13 +3243,13 @@ declare namespace sequelize { raw?: boolean; /** - * having ?!? + * having ?!? */ 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 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; @@ -3259,6 +3258,11 @@ declare namespace sequelize { * Apply DISTINCT(col) for FindAndCount(all) */ distinct?: boolean; + + /** + * Prevents a subquery on the main table when using include + */ + subQuery?: boolean; } /** diff --git a/types/sequelize/sequelize-tests.ts b/types/sequelize/sequelize-tests.ts index 830b323dcc..4363de9580 100644 --- a/types/sequelize/sequelize-tests.ts +++ b/types/sequelize/sequelize-tests.ts @@ -913,6 +913,8 @@ User.findAll( { attributes: [[s.fn('count', Sequelize.col('*')), 'count']], grou User.findAll( { attributes: [s.cast(s.fn('count', Sequelize.col('*')), 'INTEGER')] }); User.findAll( { attributes: [[s.cast(s.fn('count', Sequelize.col('*')), 'INTEGER'), 'count']] }); User.findAll( { where : s.fn('count', [0, 10]) } ); +User.findAll( { subQuery: false, include : [User], order : [[User, User, 'numYears', 'c']] } ); + User.findById( 'a string' );