Expand description
Protocol service definitions (spec section 10.4, S1D-003).
The seven services below are the server’s contract with its protocol
adapters (native RPC, HTTP/JSON, Kit, MySQL wire): adapters translate
wire requests into the canonical model of crate::request and call
these traits. The server also implements the generated gRPC services in
mongreldb_server::native.
§Errors
Every method returns CategoryError
(mongreldb_types::errors::CategoryError), the structural taxonomy of
spec section 9.7 that every language binding maps. Programmatic handling
keys off the category (or its stable code), never the message.
§Async shape: object-safe boxed futures
The traits use hand-written boxed futures (BoxFuture) instead of
native async fn in traits. Native async-fn-in-trait (stable, and usable
on this workspace’s Rust 1.88) desugars to RPITIT, which is NOT
object-safe: Arc<dyn QueryService> would be impossible, forcing every
adapter to monomorphize around concrete service types. The adapters
dispatch services dynamically, so object safety is required — and this
crate’s dependency set is frozen, so the async-trait crate is not
available to bridge the gap. The cost is one heap allocation per call,
acceptable at the protocol boundary where a call is already a network
request. The same choice gives an object-safe ArrowFrameStream
without a futures dependency.
Structs§
- Column
Schema - One column of a
TableSchema. - Execute
Response - The buffered result of a non-streaming
QueryService::execute. - Health
Status - The serving state reported by
HealthService::status. - Query
Status - The status of one query execution, as returned by
QueryService::get_query_status. - Table
Schema - The schema of one table, as returned by
CatalogService::get_schema.
Enums§
- Credentials
- Credentials presented at session open.
- Query
Phase - The execution phase of a query (S1D-006).
Traits§
- Admin
Service - Administrative operations (S1D-003). The request’s command must be
crate::request::ExecuteCommand::Admin; non-admin principals fail asmongreldb_types::errors::ErrorCategory::PermissionDenied. - Arrow
Frame Stream - A pull stream of Arrow IPC byte frames, as returned by
QueryService::execute_stream. - Auth
Service - Authentication (S1D-003): turns credentials into an
AuthenticatedIdentity. Failures fail closed asmongreldb_types::errors::ErrorCategory::Unauthenticated. - Catalog
Service - Catalog reads (S1D-003).
- Health
Service - Liveness and readiness (S1D-003).
- Query
Service - Query preparation, execution, streaming, and cancellation (S1D-003).
- Session
Service - Session lifecycle (S1D-003, S1D-004).
- Transaction
Service - Explicit transaction control on a session (S1D-003).
Type Aliases§
- BoxFuture
- The boxed future every service method returns: object-safe,
Send, and resolving toResult<T, CategoryError>. See the module-level documentation for why this is not nativeasync fnin traits.