stats: cast jsonb chunk param via text so jsonb_populate_recordset gets an array (step 2 loads)
All checks were successful
Deploy production / deploy (push) Successful in 1m11s

This commit is contained in:
2026-10-25 21:12:12 +00:00
parent 8958d3ff8f
commit 02734607cc

View File

@@ -264,7 +264,7 @@ export async function insertChunks(
.join(', ');
for (let i = 0; i < rows.length; i += size) {
await tx.unsafe(
`insert into stats.${table} (${cols}) select ${cols} from jsonb_populate_recordset(null::stats.${table}, $1::jsonb) ${conflict}`,
`insert into stats.${table} (${cols}) select ${cols} from jsonb_populate_recordset(null::stats.${table}, ($1::text)::jsonb) ${conflict}`,
[JSON.stringify(rows.slice(i, i + size))] as never
);
}