We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When a GET request is made to the REST API, parameter "total" in the response is not the actual number of items in the database table.
This behavior occurs when a service uses Sequelize with PostgreSQL and the model is defined with a composite primary key (more than one primary key).
I made a repo to reproduce the issue. Clone the repository and run docker compose run test-runner.
docker compose run test-runner
Parameter "total" must always be the actual number of items in the table, even when the model uses a composite primary key.
The text was updated successfully, but these errors were encountered:
This is likely a duplicate of feathersjs-ecosystem/feathers-sequelize#343
Sorry, something went wrong.
Just stumbled on this. Waiting for a fix, but until then try adding this to your Sequelize model (syntax as of Sequelize v4): hooks: { beforeCount(options) { options.distinct = false; }, },
Just stumbled on this. Waiting for a fix, but until then try adding this to your Sequelize model (syntax as of Sequelize v4):
hooks: { beforeCount(options) { options.distinct = false; }, },
Originally posted by @1valdis in feathersjs-ecosystem/feathers-sequelize#343 (comment)
Doing this, fixed the issue for me.
No branches or pull requests
Description
When a GET request is made to the REST API, parameter "total" in the response is not the actual number of items in the database table.
This behavior occurs when a service uses Sequelize with PostgreSQL and the model is defined with a composite primary key (more than one primary key).
Steps to reproduce
I made a repo to reproduce the issue. Clone the repository and run
docker compose run test-runner
.Expected behavior
Parameter "total" must always be the actual number of items in the table, even when the model uses a composite primary key.
The text was updated successfully, but these errors were encountered: