Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

findAll() and findAndCountAll() inconsistency: schema not applied in findAll() #10647

Closed
vigalo opened this issue Mar 29, 2019 · 1 comment
Closed

Comments

@vigalo
Copy link

vigalo commented Mar 29, 2019

Hello :

What are you doing?

When I do :

Model.findAll({ schema: {'4cfdc1df-a993-4029-8009-d9c2e5b46db3'}}).then(result => console.log(result))

the data is fetched from the public schema in the database, but when I do :

Model.findAndCountAll({ schema: {'4cfdc1df-a993-4029-8009-d9c2e5b46db3'}}).then(result => console.log(result))

the data is fetched from the intended schema as expected.

What do you expect to happen?

Two commands must return the same data from the right schema

What is actually happening?

findAll() is returning allways data from the public schema. findAndCountAll() is working as expected

__Dialect: postgres
__Sequelize version: 4.42.0
__Tested with latest release: No

@sushantdhiman
Copy link
Contributor

I don't think we support passing schema option in both findAll and findAndCountAll, model can have a schema, which worked properly for me.

Please submit SSCCE to I can reproduce this issue


( What is SSCCE ? You can find template for Sequelize here )

A few good example of SSCCE

  1. ResourceRequest timed out - connection not reestablished after db restarted #8014 (comment)
  2. removeAttribute('id') results in undefined: null data value #7318 (comment)
  3. toJSON converting booleans to "t" (true) or "f" (false) #8749 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants