MCPcopy
hub / github.com/ModelEngine-Group/nexent / _sql_repo_match

Function _sql_repo_match

deploy/sql/migrations/generate_backfill_sql.py:67–76  ·  view source on GitHub ↗

Build the WHERE fragment that matches the table's model_repo column. Bare-name catalog entries (no '/') can land in the table as either model_repo='' or model_repo IS NULL depending on the create path, so accept both. Namespaced entries match the exact string.

(repo: str)

Source from the content-addressed store, hash-verified

65
66
67def _sql_repo_match(repo: str) -> str:
68 """Build the WHERE fragment that matches the table's model_repo column.
69
70 Bare-name catalog entries (no '/') can land in the table as either
71 model_repo='' or model_repo IS NULL depending on the create path, so
72 accept both. Namespaced entries match the exact string.
73 """
74 if repo == "":
75 return "(model_repo IS NULL OR model_repo = '')"
76 return f"model_repo = '{_sql_str(repo)}'"
77
78
79def main() -> None:

Callers 1

mainFunction · 0.85

Calls 1

_sql_strFunction · 0.85

Tested by

no test coverage detected