gino
gino copied to clipboard
Docs are fixed, but there's a big piece missing on Manual Transactions
Regarding https://github.com/fantix/gino/issues/511
Exactly what syntax is used to get the "connection" that will allow the documented code to function?
Changing the doc to the correct syntax without retrofitting the docs to make the code work is a bit rough.
async with db.transaction() as tx_root:
conn = tx_root.connection
tx = await conn.transaction()
try:
people.hr["applications"].append(gapp)
await tx.commit()
except Exception:
await tx.rollback()
Connection part is covered in another chapter http://gino.fantix.pro/en/latest/engine.html#managing-connections, but yeah we can also include that here.