Skip to main content

Module request

Module request 

Source
Expand description

Canonical request model (spec section 10.4, S1D-001).

Every protocol adapter (native RPC, HTTP/JSON, Kit, MySQL wire) converts its wire form into the canonical ExecuteRequest defined here, so admission, authorization, resource governance, and execution see exactly one request shape regardless of how the request arrived.

§Deadline representation

The spec model carries deadline: Option<Instant>, but std::time::Instant is opaque, monotonic, and not serde-able, so the canonical model instead stores deadline_unix_micros: wall-clock microseconds since the Unix epoch — the same time base as mongreldb_types::hlc::HlcTimestamp::physical_micros. This form is serde-stable in every format, comparable across processes, and converts to a monotonic Instant once at server admission; queue wait, planning, execution, serialization, and network backpressure all count toward it (S1D-006). None means the server applies its configured default deadline: a request is never unbounded (spec section 4.9).

§Identity mapping

AuthenticatedIdentity is the protocol-side canonical form of the engine-side identity (mongreldb_core::auth::Principal, the handle identity carried by every open database handle):

  • AuthenticatedIdentity::CatalogUser pins the immutable catalog identity: username, user_id, and created_version map to Principal::username, Principal::user_id, and Principal::created_epoch. Roles, permissions, and the admin flag are deliberately NOT part of the wire identity: the server re-resolves them from the catalog at session open, so username reuse cannot revive a stale principal.
  • AuthenticatedIdentity::Credentialless corresponds to deployments with catalog auth disabled (embedded mode, or a daemon without --auth-users): there is no Principal at all.
  • AuthenticatedIdentity::ServicePrincipal corresponds to internal server components (replication, CDC, maintenance jobs) that act without catalog credentials. External adapters MUST never mint one; the authorization boundary fails closed on unrecognized principals.

Structs§

ExecuteRequest
The canonical request every protocol adapter converts into (S1D-001).
ResultLimits
Per-request result bounds (spec sections 4.9 and 10.4, S1D-001).
SessionId
Identifies one client session.

Enums§

AdminCommand
Administrative operations carried by ExecuteCommand::Admin.
AuthenticatedIdentity
The authenticated identity attached to a request (S1D-001).
ExecuteCommand
The operation an ExecuteRequest asks the server to perform (S1D-001).
IsolationLevel
MVCC isolation level requested by ExecuteCommand::Begin.
ParameterValue
One bound parameter value of a ExecuteCommand::Sql or ExecuteCommand::ExecutePrepared request.
SessionIdParseError
Error returned when parsing a textual SessionId fails.

Constants§

DEFAULT_MAX_BYTES
Conservative default result-size bound: 64 MiB of Arrow IPC payload.
DEFAULT_MAX_CANDIDATE_COUNT
Conservative default candidate-count bound: one million candidates.
DEFAULT_MAX_ROWS
Conservative default bounds a server applies when a request does not state one explicitly (spec section 4.9): 100 000 rows.