Module request
Expand description
Pure request shaping for the write plane’s two intake surfaces.
Transport, authentication, project fencing, body limits, and response wrapping stay in each
host. This module owns the shared path/body validation and returns either a host-neutral
PublicSqlRequest or PublicSqlRejection. Functions that validate time-bearing identities
take now_ms from the host; this module never reads a clock.
Two surfaces shape through here:
- the public
/v1/sql/*routes (shape_public_sql_request), whose failures carry the typed public error plane; and - the private deploy
/migrateroute (shape_deploy_migrations), whose failure currency is the plain 400 message both hosts already emitted. That route was left per-host by the original extraction (“shaping moves, dispatch stays” covered only/v1/sql/*), so each host grew its own parser over the same nine error strings; they live here once now.
Structs§
- Deploy
Migration Request - One private deploy migration after transport parsing. This is deliberately distinct from the
public
/v1/sql/migraterequest (PublicSqlRequest::Migration): deploy migrations also admit data-only files and an operator-reviewed checksum override. - Public
SqlRejection - A transport-neutral public SQL parse/validation failure. The host supplies only its concrete HTTP response wrapper; status, typed code, retry scope, and transaction-state semantics are fixed here.
Enums§
- Public
Read Consistency - The read routing posture selected by the public request’s explicit or client-wide default.
- Public
SqlRequest - A fully shaped request from the public SQL surface. Hosts map this value into their own dispatch currency; no transport-specific response or command type crosses this boundary.
Functions§
- shape_
deploy_ migrations - Shape the private
/migratebody into its migrations plus whether the caller used the batch form. - shape_
public_ sql_ request - Shape one public SQL path/body pair.
Nonemeans the path is not a recognized public SQL route and lets the host preserve its ordinary 404 behavior. - take_
changes - Move a validated
changesarray out of a parsed request body without cloning itsValuetree. Non-array and absent fields preserve the existing empty-vector fallback.