Giter VIP home page Giter VIP logo

Comments (5)

TriPSs avatar TriPSs commented on June 30, 2024

Which ORM are you using?

Notice, It will return the hasNextPage: false even when the totalCount indicates the existence of more records.

totalCount is not used for this, what it does it fetches n + 1, then it checks if the n is bigger then what the user provided, if yes hasNextPage will become true; this way there is no need for a additional query.

from nestjs-query.

MateoGuerreroE avatar MateoGuerreroE commented on June 30, 2024

TypeORM & Postgre - Checked the executed SQL and as you mention If I set 373 It goes for LIMIT 374 and executing that SQL manually correctly gives 374 records (On the same example provided)

from nestjs-query.

TriPSs avatar TriPSs commented on June 30, 2024

Interesting, did you log the exact query TypeORM runs? (If you enable logging) And does that one return the correct results?

from nestjs-query.

MateoGuerreroE avatar MateoGuerreroE commented on June 30, 2024

Yes, I got two on the console, one for results and one SELECT COUNT(*) which should be for the totalCount, I executed them (copy-paste) manually using dbEaver and return that extra record normally. Weird enough: I just tested again using same resolver (same code) but another DB which reaches 10.9K records and works fine. I can't see how this could be related to the database.

from nestjs-query.

TriPSs avatar TriPSs commented on June 30, 2024

Interesting, using bigints maybe? I also can't think about anything that could cause this.

Think its also impossible to create a repo that reproduces this issue?

The output between the version that works and that does not work is also exactly the same? Maybe log this within the typeorm adapter to be sure.

from nestjs-query.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.