Skip to navigation
Aiopg to get dict as a return
19.04.18
aiopg to get dict as a return import psycopg2.extras import aiopg async def open_pg(app): conf = app['config']['postgres'] con = await aiopg.connect( database=conf['database'], user=conf['user'], password=conf['password'], host=conf['host'], port=conf['port']) return con async def handler(self,request): conn = await dbs.open_pg(request.app) c = await conn.cursor(cursor_factory=psycopg2.extras.RealDictCursor)
https://aiopg.readthedocs.io/en/stable/core.html
Reply
Anonymous
Information Epoch 1714026333
Clarity is better than cleverness.
Home
Notebook
Contact us