Skip to main content

Module services

Module services 

Source
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§

ColumnSchema
One column of a TableSchema.
ExecuteResponse
The buffered result of a non-streaming QueryService::execute.
HealthStatus
The serving state reported by HealthService::status.
QueryStatus
The status of one query execution, as returned by QueryService::get_query_status.
TableSchema
The schema of one table, as returned by CatalogService::get_schema.

Enums§

Credentials
Credentials presented at session open.
QueryPhase
The execution phase of a query (S1D-006).

Traits§

AdminService
Administrative operations (S1D-003). The request’s command must be crate::request::ExecuteCommand::Admin; non-admin principals fail as mongreldb_types::errors::ErrorCategory::PermissionDenied.
ArrowFrameStream
A pull stream of Arrow IPC byte frames, as returned by QueryService::execute_stream.
AuthService
Authentication (S1D-003): turns credentials into an AuthenticatedIdentity. Failures fail closed as mongreldb_types::errors::ErrorCategory::Unauthenticated.
CatalogService
Catalog reads (S1D-003).
HealthService
Liveness and readiness (S1D-003).
QueryService
Query preparation, execution, streaming, and cancellation (S1D-003).
SessionService
Session lifecycle (S1D-003, S1D-004).
TransactionService
Explicit transaction control on a session (S1D-003).

Type Aliases§

BoxFuture
The boxed future every service method returns: object-safe, Send, and resolving to Result<T, CategoryError>. See the module-level documentation for why this is not native async fn in traits.