CopyOutReceiver¶
Receives the result of a Session.copy_out() call. The session is passed to
each callback so receivers can execute follow-up operations without needing
to store a session reference.
Public Behaviours¶
pg_copy_data¶
Called for each chunk of data received from the server during a COPY TO STDOUT operation. Data chunks do not necessarily align with row boundaries — the server may split or combine rows across chunks. The receiver should append each chunk to an output buffer or process it incrementally.
Parameters¶
pg_copy_complete¶
Called when the COPY operation completes successfully. The count is the number of rows exported.
Parameters¶
pg_copy_failed¶
Called when the COPY operation fails. The failure is either a server error
(ErrorResponseMessage) or a client-side error (ClientQueryError) such as
the session being closed, not yet authenticated, or torn down after a
server protocol violation (ProtocolViolation).
Parameters¶
- session: Session tag
- failure: (ErrorResponseMessage val | ClientQueryError)