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

Function RdbSaveGraphSchema_v13

src/serializers/encoder/v13/encode_schema.c:222–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220}
221
222void RdbSaveGraphSchema_v13(RedisModuleIO *rdb, GraphContext *gc) {
223 /* Format:
224 * attribute keys (unified schema)
225 * #node schemas
226 * node schema X #node schemas
227 * #relation schemas
228 * relation schema X #relation schemas
229 */
230
231 // Serialize all attribute keys
232 _RdbSaveAttributeKeys(rdb, gc);
233
234 // #Node schemas.
235 unsigned short schema_count = GraphContext_SchemaCount(gc, SCHEMA_NODE);
236 RedisModule_SaveUnsigned(rdb, schema_count);
237
238 // Name of label X #node schemas.
239 for(int i = 0; i < schema_count; i++) {
240 Schema *s = gc->node_schemas[i];
241 _RdbSaveSchema(rdb, s);
242 }
243
244 // #Relation schemas.
245 unsigned short relation_count = GraphContext_SchemaCount(gc, SCHEMA_EDGE);
246 RedisModule_SaveUnsigned(rdb, relation_count);
247
248 // Name of label X #relation schemas.
249 for(unsigned short i = 0; i < relation_count; i++) {
250 Schema *s = gc->relation_schemas[i];
251 _RdbSaveSchema(rdb, s);
252 }
253}
254

Callers 1

_RdbSaveHeaderFunction · 0.85

Calls 3

_RdbSaveAttributeKeysFunction · 0.85
GraphContext_SchemaCountFunction · 0.85
_RdbSaveSchemaFunction · 0.85

Tested by

no test coverage detected