question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

limit and offset options not working with not required nested model

See original GitHub issue

Issue Description

setting limit option on a query with a where statement that contains dollars signs doesn’t work.

What are you doing?

I’m trying to paginate reports (if you follow my sscce example) that has nested comments which has nested users.

Here is the link to the SSCCE for this issue: LINK-HERE https://gist.github.com/shcyiza/2a87db67253c9f293295984133ede8f5

What do you expect to happen?

Having a list of 10 reports maximum with nested comments of user that are more then 18.

What is actually happening?

missing FROM-clause entry for table \"user\"

Additional context

I want to use limit to paginate a complex set of query.

Environment

  • Sequelize version: 5.19.0
  • Node.js version: 12.12.0
  • Operating System: Mac OS

Issue Template Checklist

How does this problem relate to dialects?

  • I think this problem happens regardless of the dialect.
  • I think this problem happens only for the following dialect(s):
  • I don’t know, I was using Postgres

Would you be willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time and I know how to start.
  • Yes, I have the time but I don’t know how to start, I would need guidance.
  • No, I don’t have the time, although I believe I could do it if I had the time…
  • No, I don’t have the time and I wouldn’t even know how to start.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
fedevelacommented, May 2, 2022

Bump

1reaction
papbcommented, Jan 15, 2020

Sorry to take long to reply, I have been astronomically busy, no news I’m afraid, thanks for the patience so far

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nested include with offset and limit Sequelize - Stack Overflow
A, where: AQueryObj, include:[{ model: db.B, where: BQueryObj },{ model: db.C, where: CQueryObj }] }], offset: offset, limit: limit }.
Read more >
Chapter 4. Query Performance Optimization - O'Reilly
In the previous chapter, we explained how to optimize a schema, which is one of the necessary conditions for high performance. But working...
Read more >
Filtering multiple nested ObjectId's - Working with Data
getAll = async (req, res) => { try { const { offset, limit } ... Hi @Emile_Ibrahim , There is no problem with...
Read more >
Use nested and repeated fields | BigQuery - Google Cloud
Describes best practices to optimize a SELECT statement, such as querying only required columns, filtering partitioned queries, denormalizing data, ...
Read more >
OFFSET, FETCH and LIMIT — VQL Guide - Denodo community
In the documentation of the Denodo Platform you will find all the information you need to build Data Virtualization solutions.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found