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

Method validate_schema_exists_via_catalog

graphlite/src/exec/executor.rs:9240–9267  ·  view source on GitHub ↗

Validate schema exists via catalog

(&self, schema_reference: &CatalogPath)

Source from the content-addressed store, hash-verified

9238
9239 /// Validate schema exists via catalog
9240 fn validate_schema_exists_via_catalog(&self, schema_reference: &CatalogPath) -> bool {
9241 // Extract schema name from catalog path - use the last component
9242 let schema_name = schema_reference
9243 .segments
9244 .last()
9245 .map(|s| s.as_str())
9246 .unwrap_or("unknown");
9247
9248 // Query the schema provider to check if schema exists
9249 let query_op = CatalogOperation::Query {
9250 query_type: QueryType::Exists,
9251 params: json!({ "name": schema_name }),
9252 };
9253
9254 if let Ok(mut catalog_manager) = self.catalog_manager.write() {
9255 // Direct synchronous call - no async workarounds needed
9256 let result = catalog_manager.execute("schema", query_op);
9257 match result {
9258 Ok(CatalogResponse::Query { results }) => results
9259 .get("exists")
9260 .and_then(|v| v.as_bool())
9261 .unwrap_or(false),
9262 _ => false,
9263 }
9264 } else {
9265 false
9266 }
9267 }
9268
9269 /// Extract variable names from physical plan, falling back to first row if needed
9270 fn extract_variables_from_plan(&self, node: &PhysicalNode, rows: &[Row]) -> Vec<String> {

Callers 1

Calls 3

as_strMethod · 0.45
executeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected