Your build starts here
Replace bracketed details with your own goal, context, and checks. Keep the first build small enough to inspect.
Build a resumable batch for [development dataset] that produces [local output] in small chunks. Define the input set and a stable unique ordering before reading. Inspect the chosen database cursor's lifetime; do not save a live cursor name and assume it can be reused after a process or connection restart. Persist a job checkpoint representing committed work and bind it to the source version, query parameters, and output format. Where output and checkpoint cannot share an atomic transaction, use stable output keys and an explicit reconciliation strategy. Add fixtures with tied sort values, a duplicate attempt, and a source change. Interrupt before writing, after writing but before checkpointing, and after checkpointing. Resume each case and compare the finalized output IDs and contents with an uninterrupted run. Reject incompatible checkpoints clearly instead of skipping unknown work.Make this prompt yours
Use for long-running exports or conversions. A cursor is a traversal tool; restartability comes from the durable job and output design.
You might also hear
- resumable batch
- database cursor lifetime
- checkpoint commit
- restart export
The docs behind it
These references explain the underlying concepts and APIs. The prompt templates and project plans are original examples to adapt to your own setup.
Research sources reviewed .
Editorial review · October 28, 2026
Limited: Original instructional template; not executed. PostgreSQL cursor lifetime is distinct from durable job checkpoints; the prompt correctly accounts for output/checkpoint atomicity and incompatible source versions.