loopback-next icon indicating copy to clipboard operation
loopback-next copied to clipboard

LB4 no longer supports inqLimit for Includes.

Open cuttingd opened this issue 3 years ago • 0 comments

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

cuttingd avatar Jul 26 '22 19:07 cuttingd