loopbackio / loopbackio/loopback-next

LB4 no longer supports inqLimit for Includes.

Open
#8,773 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature feature parity
Dominant language
TypeScript
Stars
5.1k
Forks
1.1k
Avg merge
2d 21h
Merged PRs (30d)
27

Description

Describe the bug

We are migrating from lb3 to lb4 and we encountered an oracle error (Error: ORA-01795: maximum number of expressions in a list is 1000) when using an Include for one of our queries. This is as a result of the fact that it appears that lb4 no longer supports the inqLimit property on the datasource and therefore is not splitting the queries into multiple queries.

Logs
Request GET /routes?filter=%7B%22include%22:%5B%7B%22relation%22:%22connection%22,%22scope%22:%7B%22include%22:%5B%7B%22relation%22:%22partner%22%7D,%7B%22relation%22:%22sftpProfile%22%7D%5D%7D%7D,%7B%22relation%22:%22partner%22%7D,%7B%22relation%22:%22product%22,%22scope%22:%7B%22include%22:%5B%7B%22relation%22:%22program%22,%22scope%22:%7B%22include%22:%5B%7B%22relation%22:%22portfolio%22%7D%5D%7D%7D%5D%7D%7D,%7B%22relation%22:%22notifications%22,%22scope%22:%7B%22include%22:%5B%7B%22relation%22:%22contact%22%7D%5D%7D%7D,%7B%22relation%22:%22routeContacts%22,%22scope%22:%7B%22include%22:%5B%7B%22relation%22:%22contact%22%7D%5D%7D%7D%5D%7D failed with status code 500. Error: ORA-01795: maximum number of expressions in a list is 1000
mft-loopback/node_modules/@loopback/rest/dist/providers/log-error.provider.js:17
Request GET /routes?filter={%22include%22:[{%22relation%22:%20%22connection%22}]} failed with status code 500. Error: ORA-01795: maximum number of expressions in a list is 1000
Additional information

No response

Reproduction

I have no publicly available repo for reproducing this but it is an obvious issue as noted in this spike: https://github.com/loopbackio/loopback-next/blob/spike/resolve-included-models/_SPIKE_.md

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading SPIKE.md on resolving included models and trace how datasource include queries are built in the LoopBack codebase. Reproduce the reported Oracle ORA-01795 failure if possible, then verify that inqLimit is honored by splitting large include queries without breaking nested relations.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.