attempt to retrieve an index on the given label and attribute IDs
| 575 | |
| 576 | // attempt to retrieve an index on the given label and attribute IDs |
| 577 | Index GraphContext_GetIndexByID |
| 578 | ( |
| 579 | const GraphContext *gc, // graph context |
| 580 | int lbl_id, // label / rel-type ID |
| 581 | const Attribute_ID *attrs, // attributes |
| 582 | uint n, // attributes count |
| 583 | IndexType idx_type, // index type |
| 584 | GraphEntityType entity_type // schema type NODE / EDGE |
| 585 | ) { |
| 586 | // validations |
| 587 | ASSERT(gc != NULL); |
| 588 | ASSERT((attrs == NULL && n == 0) || (attrs != NULL && n > 0)); |
| 589 | |
| 590 | // retrieve the schema for given id |
| 591 | SchemaType st = (entity_type == GETYPE_NODE) ? SCHEMA_NODE : SCHEMA_EDGE; |
| 592 | Schema *s = GraphContext_GetSchemaByID(gc, lbl_id, st); |
| 593 | if(s == NULL) { |
| 594 | return NULL; |
| 595 | } |
| 596 | |
| 597 | return Schema_GetIndex(s, attrs, n, idx_type, false); |
| 598 | } |
| 599 | |
| 600 | // attempt to retrieve an index on the given label and attribute |
| 601 | Index GraphContext_GetIndex |
no test coverage detected