1
0
Fork 0
polaris-task-force/patches
Z8MB1E e3926ab828 fix(db): chunk drizzle json_build_array under postgres argument cap
Postgres caps function arguments at 100. `payload_locked_documents_rels`
holds one foreign-key column per collection, and Drizzle hydrates the
locked document's polymorphic relationship with a single
`json_build_array(...)` over all of them. At 103 collections the query
throws 54023 and every admin edit view breaks while a lock row exists.

Patch drizzle-orm 0.45.2 to split the call into 100-argument groups
joined with `::jsonb || ::jsonb`, mirroring the unmerged upstream PR
drizzle-team/drizzle-orm#4495. Relations with 100 or fewer columns keep
the original code path unchanged.

Add tests/int/locked-documents-query.int.spec.ts, which creates a lock
row and reads it back at depth 1 (what getIsLocked and
handleFormStateLocking do). It fails on pristine drizzle with the exact
54023 error and passes with the patch.
2026-10-21 10:31:11 -04:00
..
@ai-stack%2Fpayloadcms@3.2.30.patch feat(ai): switch compose model to Gemma 4 26B and patch AI plugin field-path handling 2026-09-30 14:50:32 -04:00
@payloadcms%2Fui@3.88.0.patch chore(deps): patch @payloadcms/ui and add the arma icons script 2026-10-03 03:30:49 -04:00
drizzle-orm@0.45.2.patch fix(db): chunk drizzle json_build_array under postgres argument cap 2026-10-21 10:31:11 -04:00