`findMany` returns an empty array if the number of rows is +500 approx.

Hi, Could someone tell me why the following query works if I have less than 500 nodes in the DB, but fails otherwise?
await this.db.query.nodes.findMany({
where: eq(nodes.docId, docId),
});
await this.db.query.nodes.findMany({
where: eq(nodes.docId, docId),
});
I tried limit: 100000; and nothing changed. Is there some kind of timeout?
4 Replies
GermanJablo
GermanJabloOP2mo ago
clarification: the query does not "fail" in the sense that it gives an error, but rather it returns an empty array
TOSL
TOSL2mo ago
Pretty sure this is not a Drizzle limitation. Got to be some limitation imposed by db/db provider. I'd look into that.
Beck
Beck2mo ago
Did you try to run raw SQL query that drizzle generates for you in debug mode? What your db returns if you run that (raw) query?
Mario564
Mario5645w ago
Adding onto what TOSL said, it could be a limitation with the DB, DB provider, driver or JS runtime I suggest looking up any limitations with the first two and trying to execute raw queries in them; if both return as expected, try using the driver without Drizzle.

Did you find this page helpful?