Files
romm/backend/handler/database
Sam Dornan dd6303418b fix(collections): project identifier columns instead of loading whole collections (#4589)
* fix(collections): project identifier columns instead of loading whole collections

`GET /api/collections/identifiers` reads only ids, owners and visibility, but
the accessor it called eagerly loaded every rom of every collection
(`@with_roms`) and built a full `User` per row (`Collection.user` is
`lazy="joined"`). A column projection drops both, while `load_only` cannot
cancel either one.

Measured on a seeded database of 100 collections and 200 roms (20,000
memberships): rows read 20,100 to 100, statements 2 to 1, SQL text 1,172 to
113 bytes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* test(collections): keep the new identifier assertions to one-line comments

The repo caps comments at one line when the rationale is not recoverable
from the code, and test docstrings at one sentence, so the m2m reasoning
belongs in the PR body rather than repeated at the call sites.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-17 11:42:00 -05:00
..
2026-03-12 23:02:12 -04:00
2026-04-06 22:29:55 -04:00