python fix psycopg ConnectionPool with async
Budget: $10 – $30 USD
hello we have some code of python3
pool = ConnectionPool("dbname=datadb user=postgres password=xxxxx host=localhost port= 6543")
async def checkmac(mac):
with pool.connection() as new :
query = f"SELECT ok from live where mac= '{mac}' LIMIT 1"
async with new.execute(query) as haha :
e
ouss = haha.fetchone()
so the main idea we need to make the psycopg work with pooler and aync in the same time
pool = ConnectionPool("dbname=datadb user=postgres password=xxxxx host=localhost port= 6543")
async def checkmac(mac):
with pool.connection() as new :
query = f"SELECT ok from live where mac= '{mac}' LIMIT 1"
async with new.execute(query) as haha :
e
ouss = haha.fetchone()
so the main idea we need to make the psycopg work with pooler and aync in the same time