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

Method validate_node_constraints

graphlite/src/schema/validator.rs:408–436  ·  view source on GitHub ↗
(
        &self,
        node_type: &NodeTypeDefinition,
    )

Source from the content-addressed store, hash-verified

406 }
407
408 fn validate_node_constraints(
409 &self,
410 node_type: &NodeTypeDefinition,
411 ) -> Result<(), ValidationError> {
412 for constraint in &node_type.constraints {
413 match constraint {
414 Constraint::NotNull => {
415 // Already handled in required property validation
416 }
417 Constraint::Unique => {
418 // TODO: Check uniqueness against existing data
419 }
420 Constraint::MinLength(_) => {
421 // TODO: Validate string lengths
422 }
423 Constraint::MaxLength(_) => {
424 // TODO: Validate string lengths
425 }
426 Constraint::Pattern(_) => {
427 // TODO: Validate against regex pattern
428 }
429 _ => {
430 // TODO: Implement other constraint validations
431 }
432 }
433 }
434
435 Ok(())
436 }
437}
438
439#[cfg(test)]

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected