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

Function create_constraint

tests/flow/constraint_utils.py:72–79  ·  view source on GitHub ↗
(g, ct_type, entity_type, lbl, *props, sync=False)

Source from the content-addressed store, hash-verified

70 time.sleep(0.5) # sleep 500ms
71
72def 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
81def create_unique_constraint(g, entity_type, lbl, *props, sync=False):
82 return create_constraint(g, "UNIQUE", entity_type, lbl, *props, sync=sync)

Callers 3

create_unique_constraintFunction · 0.85

Calls 1

wait_on_constraintFunction · 0.85

Tested by 1