Skip to content

Commit 888a62f

Browse files
committed
feat : Add get_metadata_from_db function to fetch full table metadata
1 parent 416ed13 commit 888a62f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

llm_utils/tools.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,20 @@ def get_info_from_db() -> List[Document]:
6666

6767
# table_info_str_list를 Document 객체 리스트로 변환
6868
return [Document(page_content=info) for info in table_info_str_list]
69+
70+
71+
def get_metadata_from_db() -> List[Dict]:
72+
"""
73+
전체 테이블의 메타데이터(테이블 이름, 설명, 컬럼 이름, 설명, 테이블 lineage, 컬럼 별 lineage)를 가져오는 함수
74+
"""
75+
76+
fetcher = _get_fetcher()
77+
urns = fetcher.get_urns()
78+
79+
metadata = []
80+
for urn in urns:
81+
print(f"Processing URN: {urn}")
82+
table_metadata = fetcher.build_table_metadata(urn)
83+
metadata.append(table_metadata)
84+
85+
return metadata

0 commit comments

Comments
 (0)