Skip to content

Cannot override rejectOnEmpty #9613

Closed
Closed

Description

@LordJimBeam

What are you doing?

If I set rejectOnEmpty to true during initialization I cannot override it in a query anymore. I would guess the error is https://github.com/sequelize/sequelize/blob/master/lib/model.js#L1681

const sequelize = new Sequelize({
  define: {
    rejectOnEmpty: true
  }
});

model.findAll({
  rejectOnEmpty: false
});

What do you expect to happen?

findAll resolves with []

What is actually happening?

findAll rejects with SequelizeEmptyResultError

Dialect: mysql (tested only mysql but suppose other dialects are affected too)
Dialect version: [email protected]
Database version: 10.1.26-MariaDB-0+deb9u1 Debian 9.1
Sequelize version: [email protected]
Tested with latest release: Yes, latest release is 4.38.0

Activity

  1. added
    type: bug
    on Jul 5, 2018
  2. sushantdhiman commented on Jul 5, 2018

    @sushantdhiman
    Contributor

    Fixed, will be released in v5.0.0-beta.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions