Add proc reset*(p: Pipeline) to clear all state explicitly
type
Pipeline* = ref object
...
autoReset*: bool ## Default: false (backward-compatible)
proc newPipeline*(conn: PgConnection, autoReset: bool = false): Pipeline =
Pipeline(conn: conn, autoReset: autoReset)
proc reset*(p: Pipeline) =
## Clear all queued ops and SoA buffers. Safe to call any time.
p.ops.setLen(0)
p.inlineData.setLen(0)
p.inlineRanges.setLen(0)
p.inlineOids.setLen(0)
p.inlineFormats.setLen(0)
# End of execute/executeIsolated:
try:
# ... Main ...
finally:
if p.autoReset:
p.reset()
Add
proc reset*(p: Pipeline)to clear all state explicitly