Merge pull request #19432 from stackbuilders/add_subquery

Include subQuery for sequelize version 3 as well
This commit is contained in:
Nathan Shively-Sanders 2017-09-05 16:07:21 -07:00 committed by GitHub
commit cbea696607
2 changed files with 6 additions and 0 deletions

View File

@ -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;
}
/**

View File

@ -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' );