MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / Schema_ContainsConstraint

Function Schema_ContainsConstraint

src/schema/schema.c:631–645  ·  view source on GitHub ↗

checks if schema constains constraint

Source from the content-addressed store, hash-verified

629
630// checks if schema constains constraint
631bool Schema_ContainsConstraint
632(
633 const Schema *s, // schema to search
634 ConstraintType t, // constraint type
635 const Attribute_ID *attrs, // constraint attributes
636 uint attr_count // number of attributes
637) {
638 // validations
639 ASSERT(s != NULL);
640 ASSERT(attrs != NULL);
641 ASSERT(attr_count > 0);
642
643 Constraint c = Schema_GetConstraint(s, t, attrs, attr_count);
644 return (c != NULL && Constraint_GetStatus(c) != CT_FAILED);
645}
646
647// retrieves constraint
648// returns NULL if constraint was not found

Callers 1

_RdbLoadConstaintFunction · 0.85

Calls 2

Schema_GetConstraintFunction · 0.85
Constraint_GetStatusFunction · 0.85

Tested by

no test coverage detected