I'm using asyncio and aiopg and after INSERT execute I can't get lastrowid.
My code:
async with aiopg.create_pool(self.connect, loop=self._loop) as pool:
async with pool.acquire() as connect:
async with connect.cursor() as cursor:
await cursor.execute("INSERT INTO users(user_firstname,user_lastname) VALUES('Johan', 'Smith')")
print(await cursor.lastrowid)
print(' - - - ')
pass
pass
pass
pass
Execute worked, but lastrowid don't printed and next print too.
Same with fetchone() and fetchall(), if I executed SELECT.
cursor.lastrowid
is a regular property, dropawait
before access to it.