Expand description
High-level synchronous client for Hyper database.
This module provides Client, the primary synchronous interface for
communicating with a Hyper server. It supports three query execution
modes, each using a different level of the PostgreSQL wire protocol:
-
Simple Query (
Client::query) — Sends a singleQuerymessage and collects allDataRowmessages into memory. Results are returned in text format. Best for small result sets or DDL/DML commands. -
Extended Query /
HyperBinary(Client::query_fast) — Uses the Extended Query protocol (Parse/Bind/Execute) withColumnFormat::HyperBinary(format code 2) forLittleEndianbinary results. ReturnsStreamRows that compute field offsets on-demand, avoiding per-row allocation. -
Streaming (
Client::query_streaming) — Likequery_fastbut returns aQueryStreamthat yields rows in chunks, keeping memory usage constant regardless of result set size. The stream holds the connection lock for its lifetime; dropping it triggers a cancel request to stop the server from streaming the rest.
§Bulk Insertion (COPY Protocol)
Client::copy_in starts a COPY ... FROM STDIN WITH (FORMAT HYPERBINARY)
session and returns a CopyInWriter for streaming binary data. The
caller is responsible for encoding rows in the correct format (typically
done by the higher-level hyperdb_api::Inserter).
See also copy_in_with_format for
alternative formats (CSV, Arrow IPC) and copy_in_raw
for fully custom COPY statements.
Structs§
- Client
- A synchronous client for Hyper database.
- Copy
InWriter - A writer for COPY IN operations.
- Query
Stream - Streaming iterator for query results without materializing all rows.