MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / ddl_kind

Function ddl_kind

src/codegraphcontext/utils/cypher_ddl.py:68–80  ·  view source on GitHub ↗

Return ``'index'``, ``'constraint'``, ``'fulltext'`` or ``None``.

(query: str)

Source from the content-addressed store, hash-verified

66
67
68def ddl_kind(query: str) -> str | None:
69 """Return ``'index'``, ``'constraint'``, ``'fulltext'`` or ``None``."""
70 if not isinstance(query, str):
71 return None
72 stripped = strip_cypher_literals(query)
73 if _PROC_DDL_RE.match(stripped):
74 return "fulltext"
75 match = _DDL_RE.match(stripped)
76 if not match:
77 return None
78 if (match.group("qualifier") or "").upper() == "FULLTEXT":
79 return "fulltext"
80 return match.group("object").lower()

Callers 3

Calls 1

strip_cypher_literalsFunction · 0.85

Tested by 2