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

Function CreateEdge

src/graph/graph_hub.c:123–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123void CreateEdge
124(
125 GraphContext *gc,
126 Edge *e,
127 NodeID src,
128 NodeID dst,
129 RelationID r,
130 AttributeSet set,
131 bool log
132) {
133 ASSERT(e != NULL);
134 ASSERT(gc != NULL);
135
136 Graph_CreateEdge(gc->g, src, dst, r, e);
137 *e->attributes = set;
138
139 Schema *s = GraphContext_GetSchemaByID(gc, r, SCHEMA_EDGE);
140 // all schemas have been created in the edge blueprint loop or earlier
141 ASSERT(s != NULL);
142 Schema_AddEdgeToIndices(s, e);
143
144 // add edge creation operation to undo log
145 if(log == true) {
146 UndoLog undo_log = QueryCtx_GetUndoLog();
147 UndoLog_CreateEdge(undo_log, e);
148 EffectsBuffer *eb = QueryCtx_GetEffectsBuffer();
149 EffectsBuffer_AddCreateEdgeEffect(eb, e);
150 }
151}
152
153// delete a node
154// remove the node from the relevant indexes

Callers 2

ApplyCreateEdgeFunction · 0.85
_CommitEdgesFunction · 0.85

Calls 7

Graph_CreateEdgeFunction · 0.85
Schema_AddEdgeToIndicesFunction · 0.85
QueryCtx_GetUndoLogFunction · 0.85
UndoLog_CreateEdgeFunction · 0.85

Tested by

no test coverage detected