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

Function AddSchema

src/graph/graph_hub.c:440–459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

438}
439
440Schema *AddSchema
441(
442 GraphContext *gc, // graph context to add the schema
443 const char *label, // schema label
444 SchemaType t, // schema type (node/edge)
445 bool log // should operation be logged in the undo-log
446) {
447 ASSERT(gc != NULL);
448 ASSERT(label != NULL);
449 Schema *s = GraphContext_AddSchema(gc, label, t);
450
451 if(log == true) {
452 UndoLog undo_log = QueryCtx_GetUndoLog();
453 UndoLog_AddSchema(undo_log, s->id, s->type);
454 EffectsBuffer *eb = QueryCtx_GetEffectsBuffer();
455 EffectsBuffer_AddNewSchemaEffect(eb, Schema_GetName(s), s->type);
456 }
457
458 return s;
459}
460
461Attribute_ID FindOrAddAttribute
462(

Callers 5

_Constraint_CreateFunction · 0.85
ApplyAddSchemaFunction · 0.85
UpdateNodeLabelsFunction · 0.85
_CommitNodesBlueprintFunction · 0.85
_CommitEdgesBlueprintFunction · 0.85

Calls 6

GraphContext_AddSchemaFunction · 0.85
QueryCtx_GetUndoLogFunction · 0.85
UndoLog_AddSchemaFunction · 0.85
Schema_GetNameFunction · 0.85

Tested by

no test coverage detected