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.

Filters max size is exceeded

See original GitHub issue

Bug description

The code below works well:

const ids = new Array(32768 - 2).fill(0).map((_, i) => i); // 2^15-2

const count = await prisma.user.count({
  where: { id: { in: ids } }
});

But if you increase array size to 2^15 - 1 it throws the error:

Can't reach database server at `localhost`:`5432`

Is it known Prisma limitation?

How to reproduce

  1. Create any database using prisma even without data
  2. Execute the code above

Environment & setup

  • OS: Linux
  • Database: PostgreSQL
  • Node.js version: 16.14.2

Prisma Version

3.14.0

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jkomynocommented, Sep 23, 2022

Thank you for this issue. This is a duplicate of #8832. In the example query above, we’re hitting the maximum allowed number of bind variables in a prepared statement supported by the Postgres driver we’re using (the driver’s limit is 32767).

0reactions
Jolg42commented, Sep 7, 2022

Can reproduce on our internal dev version 4.4.0-dev.30 with

  const ids = new Array(32768 - 1).fill(0).map((_, i) => i);
  const count = await prisma.user.count({
    where: { id: { in: ids } },
  });
  console.log({ count });
Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: Filter Array result size that exceeded
I have a loop in the list(personal number) and Filter Array inside the loop but Filter array exceeded the maximum value '209715200' bytes ......
Read more >
Solved: workaround for Camera Raw Smart Filter if image ex...
I made my image a Smart Object so I could create a Camera Raw Smart Filter - but I get the message "The...
Read more >
Maximum call stack size exceeded when filtering objects with ...
filtered("age > 30"); The result of this query is the following error: Maximum call stack size exceeded. I expect to have a list...
Read more >
matlab filter: max variable size allowed by function, error
Maximum variable size allowed by the function is exceeded. Error in dfilt.singlefilterquantizer/firinterpfilter (line 11). [y,z,tapidx] = sfirinterpfilter(p ...
Read more >
Help with filter String exceeding maximum length — mibuso.com
Maybe you should rethink the design or concept of your solution. Using a string as a filter will always run into its 250...
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