MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / execute_read_only

Method execute_read_only

graphlite/src/catalog/traits.rs:72–90  ·  view source on GitHub ↗

Handle read-only catalog operations (queries) This method handles operations that don't modify catalog state, allowing for concurrent read access without requiring mutable references. # Arguments `op` - The catalog operation to execute (should be read-only) # Returns `Ok(CatalogResponse)` with the operation result `Err(CatalogError)` if the operation fails or is not read-only

(&self, op: CatalogOperation)

Source from the content-addressed store, hash-verified

70 /// * `Ok(CatalogResponse)` with the operation result
71 /// * `Err(CatalogError)` if the operation fails or is not read-only
72 fn execute_read_only(&self, op: CatalogOperation) -> CatalogResult<CatalogResponse> {
73 // Default implementation: For most catalogs, query operations can be safely
74 // executed in read-only mode since they don't modify state. This is a
75 // temporary bridge until all catalogs implement proper read-only methods.
76 use super::error::CatalogError;
77 match op {
78 CatalogOperation::Query { .. } => {
79 // For now, return a temporary error encouraging migration
80 Err(CatalogError::NotSupported(
81 "Read-only queries not yet implemented for this catalog. \
82 Consider implementing execute_read_only() for better concurrency."
83 .to_string(),
84 ))
85 }
86 _ => Err(CatalogError::NotSupported(
87 "Only query operations are supported in read-only mode".to_string(),
88 )),
89 }
90 }
91
92 /// Persist catalog state to storage
93 ///

Callers

nothing calls this directly

Implementers 6

graph_type.rsgraphlite/src/schema/catalog/graph_typ
graph_type_old.rsgraphlite/src/schema/catalog/graph_typ
schema.rsgraphlite/src/catalog/providers/schema
security.rsgraphlite/src/catalog/providers/securi
index.rsgraphlite/src/catalog/providers/index.
graph_metadata.rsgraphlite/src/catalog/providers/graph_

Calls

no outgoing calls

Tested by

no test coverage detected