| 438 | } |
| 439 | |
| 440 | Schema *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 | |
| 461 | Attribute_ID FindOrAddAttribute |
| 462 | ( |
no test coverage detected