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

Function main1

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

Source from the content-addressed store, hash-verified

38
39
40async def main1():
41 connection_string = (
42 f"dbname='{DB}' user='{USER}' password='{PASSWORD}' host='{HOST}' port={PORT}"
43 )
44 pool = AsyncConnectionPool(connection_string, open=False)
45 await pool.open()
46
47 try:
48 conn = await pool.getconn(timeout=10)
49 async with conn.cursor() as curs:
50 try:
51 await curs.execute('SET search_path = ag_catalog, "$user", public')
52 await curs.execute("SELECT create_graph('dickens-2')")
53 await conn.commit()
54 print("create_graph success")
55 except (
56 psycopg.errors.InvalidSchemaName,
57 psycopg.errors.UniqueViolation,
58 ):
59 print("create_graph already exists")
60 await conn.rollback()
61 finally:
62 pass
63
64
65db = PostgreSQLDB(

Callers

nothing calls this directly

Calls 1

executeMethod · 0.45

Tested by

no test coverage detected