Expand description
Host-side helpers for procedure execution and principal threading.
Two helpers consolidate the §1.2 duplication flagged in
CODE_SIMPLIFIER_FEEDBACK.md:
context::build_procedure_context— replaces the duplicated “construct host + attach writer + read principal + build context” block betweenuni-query/src/query/executor/procedure.rsanduni-query/src/query/df_graph/procedure_call.rs.principal::maybe_scope_with_principal— wraps the conditionalmatch principal { Some(p) => scoped_with_principal(...).await, None => fut.await }pattern duplicated acrossuni::api::{session,transaction}anduni-query::df_udfs.
The principal task-local (principal::CURRENT_PRINCIPAL) and its
scoped_with_principal / current_principal helpers also live here.
uni-query re-exports them for backwards compatibility.
Modules§
Statics§
- CURRENT_
PRINCIPAL - Tokio task-local carrying the authenticated principal for the in-flight query.
Functions§
- build_
procedure_ context - Build a
ProcedureContextwiringhostand an optionalprincipal. - current_
principal - Borrow the principal active for the current execute scope, if any.
- maybe_
scope_ with_ principal - Run
futeither inside a principal task-local scope or unwrapped, depending on whether a principal was supplied. - scoped_
with_ principal - Run
futinside a scope wherecurrent_principalresolves toprincipal.