0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-02-11 01:18:24 -05:00
immich/server
Michael Manganiello e262298090
fix(server): Split database queries based on PostgreSQL bound params limit (#6034)
* fix(server): Split database queries based on PostgreSQL bound params limit

PostgreSQL uses a 16-bit integer to indicate the number of bound
parameters.

This means that the maximum number of parameters for any query is 65535.
Any query that tries to bind more than that (e.g. searching by a list of
IDs) requires splitting the query into multiple chunks.

This change includes refactoring every Repository that runs queries
using a list of ids, and either flattening or merging results.

Fixes #5788, #5997.

Also, potentially a fix for #4648 (at least based on
[this comment](https://github.com/immich-app/immich/issues/4648#issuecomment-1826134027)).

References:

* https://github.com/typeorm/typeorm/issues/7565
* [PostgreSQL message format - Bind](https://www.postgresql.org/docs/15/protocol-message-formats.html#PROTOCOL-MESSAGE-FORMATS-BIND)

* misc: Create Chunked decorator to simplify implementation

* feat: Add ChunkedArray/ChunkedSet decorators
2024-01-06 20:36:12 -05:00
..
bin chore(server): faster shutdown (#5577) 2023-12-08 21:58:07 -05:00
openapi-generator
resources feat: postgres reverse geocoding (#5301) 2023-11-25 18:53:30 +00:00
src fix(server): Split database queries based on PostgreSQL bound params limit (#6034) 2024-01-06 20:36:12 -05:00
test feat(server): in upload folder, split the files into folders based on the first four of the files uuid (#6175) 2024-01-04 14:45:16 -06:00
.eslintrc.js chore(server): curly braces (#5361) 2023-11-28 15:09:20 -05:00
.gitignore feat(web): re-add open graph tags for public share links (#5635) 2023-12-11 13:37:47 -06:00
.prettierignore
.prettierrc
Dockerfile feat(server): add rw2 support (#6231) 2024-01-06 23:58:04 +00:00
immich-openapi-specs.json feat(web): onboarding (#6066) 2024-01-04 05:28:32 +00:00
nest-cli.json
openapitools.json
package-lock.json fix(deps): update server (#6119) 2024-01-03 17:41:30 -05:00
package.json fix(deps): update dependency @nestjs/schedule to v4 (#5348) 2024-01-01 22:25:25 -05:00
start-microservices.sh
start-server.sh
start.sh fix(server): immich command (#5408) 2023-11-30 14:59:47 -06:00
tsconfig.build.json
tsconfig.json fix(server): better fix for the OAuth Discovery errors (#4695) 2023-10-30 13:22:30 -04:00