Clears the cursor AND every table the manifest declares, so a re-migration starts from empty rather than colliding with its own previous rows.
Destructive by definition, which is why the route gates it behind an explicit flag.
Runs to completion. The paid-plan and local shape; on free this is 227x the ceiling.
Everything a diagnostics route needs about the migration, in one read.
The JSDoc @returns that used to sit here was WRONG -- it claimed
{state, chunk, chunks, done} while the method returns generation, chunks, statements,
rows, cursor, done and started. It went unnoticed because JSDoc types on a .js file are
advisory; once the file became TypeScript the declared MigrateStatus contradicted it in
plain sight, which is the argument for the conversion in one line.
Replays up to maxChunks chunks, then returns.
One chunk is the default because one chunk is the unit sized to fit a single
invocation's CPU budget. maxChunks: Infinity is the paid-plan and local path,
where the whole migration in one invocation is simply cheaper.
A chunk that throws leaves the database exactly as it was and records the error on the cursor without advancing it, so the next call retries the same chunk rather than skipping it. Skipping a failed chunk is how you get a site that renders and is quietly missing rows.
Drives the chunk replay.
loadManifest/loadChunkare injected rather than readingenv.ASSETSdirectly so the gate tests can replay the real shipped chunks off disk into a real SQLite without a dev server.nowis injected for the same reason.