Skip to main content

Module copy

Module copy 

Source
Expand description

PostgreSQL COPY statement envelopes and stream codecs.

COPY FROM STDIN and COPY TO STDOUT carry their byte stream outside the SQL statement. The regular crate::compile entry point therefore cannot execute one by itself; callers use compile_copy to validate the SQL envelope and pair it with the stream through the engine COPY API.

Structs§

CopyOptions
Parsed COPY options after format-dependent defaults have been applied.
CopyStatement
Fully validated COPY statement envelope.

Enums§

CopyDirection
COPY stream direction.
CopyEndpoint
Where PostgreSQL expects the COPY stream to be connected.
CopyFormat
COPY data encoding implemented by the embedded stream API.
CopyHeader
PostgreSQL’s three HEADER states.
CopyTarget
The relation or query supplying COPY rows.

Functions§

compile_copy
Parse exactly one PostgreSQL COPY statement.
decode_copy_input
Decode a complete text or CSV COPY stream into rows.
encode_copy_result
Encode one SQL result using PostgreSQL COPY text or CSV representation.
encode_copy_result_with_engine
Encode one SQL result while resolving catalog-backed reg* text output through the engine hook.

Type Aliases§

CopyInputField
One decoded COPY field. None is SQL NULL; strings remain in PostgreSQL’s textual input representation so the target column’s normal input coercion remains authoritative.