(g, ct_type, entity_type, lbl, *props, sync=False)
| 70 | time.sleep(0.5) # sleep 500ms |
| 71 | |
| 72 | def create_constraint(g, ct_type, entity_type, lbl, *props, sync=False): |
| 73 | args = ["GRAPH.CONSTRAINT", "CREATE", g.name, ct_type, entity_type, lbl, "PROPERTIES", len(props)] |
| 74 | args.extend(props) |
| 75 | res = g.execute_command(*args) |
| 76 | if sync: |
| 77 | wait_on_constraint(g, ct_type, entity_type, lbl, *props) |
| 78 | |
| 79 | return res |
| 80 | |
| 81 | def create_unique_constraint(g, entity_type, lbl, *props, sync=False): |
| 82 | return create_constraint(g, "UNIQUE", entity_type, lbl, *props, sync=sync) |