Expand description
The statement lifecycle state machine: submit -> poll/await -> partition assembly, as a pure, synchronous Mealy machine.
Implements bead fsnow-statement-lifecycle-ofl. The machine holds all the
lifecycle logic — status routing, the bounded poll loop, and multi-partition
row assembly — but performs no IO: a caller feeds it each response
(status class + body bytes) and it returns the next Progress step. That
makes the whole flow testable end-to-end against the deterministic, no-socket
franken_snowflake_testkit::mock::MockSqlApi without a runtime.
The async glue that pumps this machine against the live
franken-snowflake-http transport (and fires the remote cancel endpoint on
local cancellation) lives in crate::driver. Gzip partition bodies are
decompressed by the transport, so the machine always receives decoded
partition bytes.
Structs§
- Completed
Statement - The fully-assembled result of a completed statement: the parsed terminal
ResultSet(metadata + inline partition-0 rows) plus every row across all fetched partitions, concatenated in partition order. - Lifecycle
Error - A lifecycle-orchestration error (distinct from a protocol timeout/failure,
which are
Progress::TimedOut/Progress::Failed). - Poll
Plan - How a
202handle is polled: how many times, and how long to wait betweenGETs. - Statement
Machine - The pure statement lifecycle driver. Construct with
StatementMachine::new, then feed each response withStatementMachine::on_submit/StatementMachine::on_poll/StatementMachine::on_partition.
Enums§
- Lifecycle
Error Code - Stable
LifecycleErrorclasses. - Progress
- The next step a caller should take after feeding the machine a response.
Constants§
- DEFAULT_
PARTITION_ CONCURRENCY - Default partition fetch window.
- MAX_
PARTITION_ CONCURRENCY - Largest partition fetch window a caller may request.
- MIN_
POLL_ INTERVAL - Lower bound on the inter-poll wait so a
202poll loop can never degrade into a tight, API-hammering spin (which would also burn the whole poll quota in milliseconds and provoke server-side429rate limiting).
Functions§
- parse_
partition_ rows - Decode a non-inline partition body: a bare JSON array of rows.