graph/db+sqldb: delete channels in batches

Use the new `SLICES` directive to add a DeleteChannels query which takes
a set of DB channel IDs. Then replace all our calls to DeleteChannel
with a paginated call to DeleteChannels.
This commit is contained in:
Elle Mouton committed 2025-07-22 17:17:23 +02:00
1 parent de6c030f29
commit ddc0e95eda
4 files changed
+69 -33

No files matched your search

+3 -2
View File
@@ -569,8 +569,9 @@ WHERE c.version = $1 AND c.id > $2
ORDER BY c.id
LIMIT $3;
-- name: DeleteChannel :exec
DELETE FROM graph_channels WHERE id = $1;
-- name: DeleteChannels :exec
DELETE FROM graph_channels
WHERE id IN (sqlc.slice('ids')/*SLICE:ids*/);
/* ─────────────────────────────────────────────
graph_channel_features table queries