diff --git a/types/sequelize/v3/index.d.ts b/types/sequelize/v3/index.d.ts index 65db1b3822..d777303d94 100644 --- a/types/sequelize/v3/index.d.ts +++ b/types/sequelize/v3/index.d.ts @@ -3221,6 +3221,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/v3/sequelize-tests.ts b/types/sequelize/v3/sequelize-tests.ts index 3f1ef022bb..4a3ba51753 100644 --- a/types/sequelize/v3/sequelize-tests.ts +++ b/types/sequelize/v3/sequelize-tests.ts @@ -896,6 +896,7 @@ User.findAll( { attributes: [[s.fn('count', Sequelize.col('*')), 'count']] }); User.findAll( { attributes: [[s.fn('count', Sequelize.col('*')), 'count']], group: ['sex'] }); 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( { subQuery: false, include : [User], order : [['id', 'ASC NULLS LAST']] } ); User.findById( 'a string' );