MCPcopy Index your code
hub / github.com/KnowledgeXLab/LeanRAG / search_community

Function search_community

database_utils.py:388–400  ·  view source on GitHub ↗
(entity_name,working_dir)

Source from the content-addressed store, hash-verified

386 return text_units
387
388def search_community(entity_name,working_dir):
389 db = pymysql.connect(host='localhost',port=4321, user='root',
390 passwd='123', charset='utf8mb4')
391 db_name=os.path.basename(working_dir)
392 cursor = db.cursor()
393 sql=f"select * from {db_name}.communities where entity_name=%s"
394 cursor.execute(sql,(entity_name,))
395 ret=cursor.fetchall()
396 if len(ret)!=0:
397 return ret[0]
398 else:
399 return ""
400 # return ret[0]
401def insert_origin_relations(working_dir):
402 dbname=os.path.basename(working_dir)
403 db = pymysql.connect(host='localhost',port=4321, user='root',

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected