Skip to content

fix(game): page through games in the genre backfill - #53

Merged
neo773 merged 1 commit into
masterfrom
fix/backfill-genres-batching
Sep 20, 2026
Merged

neo773 merged 1 commit into
masterfrom
fix/backfill-genres-batching

Conversation

@neo773

@neo773 neo773 commented Sep 20, 2026

Copy link
Copy Markdown
Owner

backfill-game-genres loaded every row in a single select. That works against a local sqlite file, but production runs libSQL over HTTP:

SELECT id,name,genres FROM Game LIMIT 50000  ->  OK
SELECT id,name,genres FROM Game              ->  RESPONSE_TOO_LARGE

86,366 rows. So the backfill could never run against production — it failed immediately on the read, before touching anything.

Now reads in keyset-paginated batches of 5,000 ordered by id. Updates don't touch the id, so the cursor stays stable while rows are being rewritten. Progress logged every 20,000.

Found while running the backfill on prod after #51/#52. Column backed up first (/home/opc/backups/game-genres-*.json, 86,366 rows).

Checks: tsc (root + server), lint, format, 106/106 tests.

🤖 Generated with Claude Code

The command loaded every row in one select. That works against a local
sqlite file but production runs libSQL over HTTP, which rejects the
86,366-row response with RESPONSE_TOO_LARGE, so the backfill could never
run against prod.

Reads in keyset-paginated batches of 5,000 ordered by id. Updates do not
touch the id, so the cursor stays stable while rows are being rewritten.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@neo773
neo773 merged commit d0d7e61 into master Sep 20, 2026
2 checks passed
@neo773
neo773 deleted the fix/backfill-genres-batching branch September 20, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant