MCPcopy
hub / github.com/HKUDS/MiniRAG / main

Function main

minirag/kg/postgres_impl_test.py:116–132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

114
115
116async def main():
117 pool = await get_pool()
118 sql = r"SELECT * FROM ag_catalog.cypher('dickens', $$ MATCH (n:帅哥) RETURN n $$) AS (n ag_catalog.agtype)"
119 # cypher = "MATCH (n:how_are_you_doing) RETURN n"
120 async with pool.acquire() as conn:
121 try:
122 await conn.execute(
123 """SET search_path = ag_catalog, "$user", public;select create_graph('dickens')"""
124 )
125 except asyncpg.exceptions.InvalidSchemaNameError:
126 print("create_graph already exists")
127 # stmt = await conn.prepare(sql)
128 row = await conn.fetch(sql)
129 print("row is: ", row)
130
131 row = await conn.fetchrow("select '100'::int + 200 as result")
132 print(row) # <Record result=300>
133
134
135if __name__ == "__main__":

Callers

nothing calls this directly

Calls 2

get_poolFunction · 0.85
executeMethod · 0.45

Tested by

no test coverage detected