pub struct QueryProcedureHost { /* private fields */ }Expand description
Host facade exposing a snapshot of GraphExecutionContext to
in-tree procedure plugins.
Built-in host-coupled procedures invoked via CALL uni.X receive a
ProcedureContext whose host field points at a QueryProcedureHost
constructed by the dispatch sites
(procedure_call::execute_plugin_procedure and
executor::procedure). Plugins downcast to recover the concrete
type, then call the typed accessors below.
All fields are owned (Arc-shared) rather than borrowed, so the host
is 'static-friendly — which is the constraint
std::any::Any imposes for downcasting. Construction is a small
number of Arc-clones; the per-call cost is negligible.
Implementations§
Source§impl QueryProcedureHost
impl QueryProcedureHost
Sourcepub fn from_graph_ctx(graph_ctx: &GraphExecutionContext) -> Self
pub fn from_graph_ctx(graph_ctx: &GraphExecutionContext) -> Self
Snapshot the host-shaped components of graph_ctx. The
per-request fields start empty; use
Self::from_graph_ctx_with_request when the surrounding query
has projection / yield context.
Sourcepub fn from_graph_ctx_with_request(
graph_ctx: &GraphExecutionContext,
target_properties: HashMap<String, Vec<String>>,
yield_items: Vec<(String, Option<String>)>,
expected_schema: Option<SchemaRef>,
) -> Self
pub fn from_graph_ctx_with_request( graph_ctx: &GraphExecutionContext, target_properties: HashMap<String, Vec<String>>, yield_items: Vec<(String, Option<String>)>, expected_schema: Option<SchemaRef>, ) -> Self
Snapshot the host-shaped components of graph_ctx along with
the per-request projection map, YIELD list, and planner-expected
output schema. Used by the DataFusion procedure dispatcher
(procedure_call.rs::execute_plugin_procedure) to feed search
procedures (uni.vector.query etc.) everything they need to
expand node yields into the planner-expected column shape.
Sourcepub fn from_components(
storage: Arc<StorageManager>,
algo_registry: Option<Arc<AlgorithmRegistry>>,
procedure_registry: Option<Arc<ProcedureRegistry>>,
) -> Self
pub fn from_components( storage: Arc<StorageManager>, algo_registry: Option<Arc<AlgorithmRegistry>>, procedure_registry: Option<Arc<ProcedureRegistry>>, ) -> Self
Construct a host from raw components (used by the simple
executor, which holds these directly rather than via a
GraphExecutionContext).
Sourcepub fn with_writer(self, writer: Arc<Writer>) -> Self
pub fn with_writer(self, writer: Arc<Writer>) -> Self
Attach the outer transaction’s writer handle to this host.
Required for Write/Schema/Dbms-mode invocations of
Self::execute_inner_query. Call sites that construct a host
inside a write transaction should thread the writer through; the
inner-query path otherwise has no path to mutate the graph.
Sourcepub fn allocate_transient_id(&self) -> u64
pub fn allocate_transient_id(&self) -> u64
Allocate a fresh transient id, unique within this host’s
lifetime. Wraps the bottom 63 bits and OR-s in the ephemeral
bit before returning. Use Vid::ephemeral / Eid::ephemeral
when you want the typed Vid / Eid form.
Always available — no capability is required. Per proposal §4.13.1, IDs are stable only within a single query execution.
Sourcepub fn storage(&self) -> &Arc<StorageManager> ⓘ
pub fn storage(&self) -> &Arc<StorageManager> ⓘ
Storage manager — schema, datasets, vector / fts search.
Sourcepub fn algo_registry(&self) -> Option<&Arc<AlgorithmRegistry>>
pub fn algo_registry(&self) -> Option<&Arc<AlgorithmRegistry>>
Algorithm registry, if the host wired one in.
Sourcepub fn procedure_registry(&self) -> Option<&Arc<ProcedureRegistry>>
pub fn procedure_registry(&self) -> Option<&Arc<ProcedureRegistry>>
Procedure registry, if the host wired one in.
Sourcepub fn xervo_runtime(&self) -> Option<&Arc<ModelRuntime>>
pub fn xervo_runtime(&self) -> Option<&Arc<ModelRuntime>>
Uni-Xervo runtime for query-time auto-embedding, if wired.
Sourcepub fn property_manager(&self) -> Option<&Arc<PropertyManager>>
pub fn property_manager(&self) -> Option<&Arc<PropertyManager>>
Property manager for lazy property loading, if the host wired
one in. Returns None on the simple-executor path
(from_components does not have access to it).
Sourcepub fn target_properties(&self) -> &HashMap<String, Vec<String>>
pub fn target_properties(&self) -> &HashMap<String, Vec<String>>
Per-request projection map (output variable name → requested
property names). Empty unless the host was constructed via
Self::from_graph_ctx_with_request with non-empty data.
Sourcepub fn yield_items(&self) -> &[(String, Option<String>)]
pub fn yield_items(&self) -> &[(String, Option<String>)]
Per-request YIELD list as (yield_name, alias) pairs.
Sourcepub fn expected_schema(&self) -> Option<&SchemaRef>
pub fn expected_schema(&self) -> Option<&SchemaRef>
Planner-expected output schema. Used by search procedures to emit columns matching the schema the surrounding query plan expects, avoiding a name-mismatch reprojection step in the dispatcher.
Sourcepub fn l0_context(&self) -> &L0Context
pub fn l0_context(&self) -> &L0Context
L0 visibility context (current / pending / transaction buffers).
Sourcepub fn query_context(&self) -> QueryContext
pub fn query_context(&self) -> QueryContext
Build a QueryContext for property-manager calls. Mirrors
GraphExecutionContext::query_context.
Sourcepub async fn execute_inner_query(
&self,
cypher: &str,
params: &HashMap<String, Value>,
mode: ProcedureMode,
) -> Result<Vec<HashMap<String, Value>>>
pub async fn execute_inner_query( &self, cypher: &str, params: &HashMap<String, Value>, mode: ProcedureMode, ) -> Result<Vec<HashMap<String, Value>>>
Run an inner Cypher query against the same storage / L0 snapshot the outer procedure sees, returning the materialised row vector.
Used by:
- the V2 algorithm adapter (M5c.3) to materialise
ProjectionInput::Cypher { node_query, edge_query, ... }; - the meta-plugin persistence backend (M9 cutover) to issue
MERGE (:_DeclaredPlugin {...})through Cypher; - the synthetic-procedure plugin (M9 cutover) to evaluate the
stored body of a
CALL uni.plugin.declareProcedure(...).
mode controls which Cypher operations are accepted:
ProcedureMode::Readconstructs the inner executor without a writer; mutation clauses (CREATE,SET,MERGE,DELETE,REMOVE) fail with “Database is in read-only mode”.ProcedureMode::Write/ProcedureMode::Schema/ProcedureMode::Dbmsconstruct the inner executor with the outer transaction’s writer handle (set viaSelf::with_writer); mutations land in the outer transaction’s L0 buffer. If no writer was threaded through, write-mode invocations error with"inner write requires a writer-enabled procedure host".
L0 visibility mirrors the outer query’s snapshot
(l0_context.current_l0 / transaction_l0 /
pending_flush_l0s) so recently-written rows are visible. The
PropertyManager is reused from the outer host when present;
otherwise a fresh per-call one is constructed.
params are bound into the inner executor by name, exactly as
session.query(cypher, params) would for a top-level Cypher
query.
§Errors
Returns any parse / plan / execution error from the inner
query. Write-attempt errors in Read mode propagate as the
host’s “Database is in read-only mode” string. Write-mode
invocations without a writer attached return a clear error
rather than silently downgrading to read-only.
Sourcepub fn check_timeout(&self) -> Result<()>
pub fn check_timeout(&self) -> Result<()>
Check whether the query has timed out or been cancelled.
§Errors
Returns an error if the deadline has passed or the cancellation token has been triggered.
Trait Implementations§
Source§impl Clone for QueryProcedureHost
impl Clone for QueryProcedureHost
Source§fn clone(&self) -> QueryProcedureHost
fn clone(&self) -> QueryProcedureHost
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ProcedureHost for QueryProcedureHost
impl ProcedureHost for QueryProcedureHost
Auto Trait Implementations§
impl !RefUnwindSafe for QueryProcedureHost
impl !UnwindSafe for QueryProcedureHost
impl Freeze for QueryProcedureHost
impl Send for QueryProcedureHost
impl Sync for QueryProcedureHost
impl Unpin for QueryProcedureHost
impl UnsafeUnpin for QueryProcedureHost
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T> MaybeSend for Twhere
T: Send,
impl<T> MaybeSend for Twhere
T: Send,
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.impl<T> PluginState for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.