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

Function CreateNode

src/graph/graph_hub.c:92–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92void CreateNode
93(
94 GraphContext *gc,
95 Node *n,
96 LabelID *labels,
97 uint label_count,
98 AttributeSet set,
99 bool log
100) {
101 ASSERT(n != NULL);
102 ASSERT(gc != NULL);
103
104 Graph_CreateNode(gc->g, n, labels, label_count);
105 *n->attributes = set;
106
107 // add node labels
108 for(uint i = 0; i < label_count; i++) {
109 Schema *s = GraphContext_GetSchemaByID(gc, labels[i], SCHEMA_NODE);
110 ASSERT(s);
111 Schema_AddNodeToIndices(s, n);
112 }
113
114 // add node creation operation to undo log
115 if(log == true) {
116 UndoLog undo_log = QueryCtx_GetUndoLog();
117 UndoLog_CreateNode(undo_log, n);
118 EffectsBuffer *eb = QueryCtx_GetEffectsBuffer();
119 EffectsBuffer_AddCreateNodeEffect(eb, n, labels, label_count);
120 }
121}
122
123void CreateEdge
124(

Callers 2

ApplyCreateNodeFunction · 0.85
_CommitNodesFunction · 0.85

Calls 7

Graph_CreateNodeFunction · 0.85
Schema_AddNodeToIndicesFunction · 0.85
QueryCtx_GetUndoLogFunction · 0.85
UndoLog_CreateNodeFunction · 0.85

Tested by

no test coverage detected