Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. def execute_with_params(queries, params):
  2. conn = await aiomysql.connect(.....)
  3.  
  4. async with conn.cursor() as cursor:
  5. try:
  6. for query, param in queries, params:
  7. await cursor.execute(query, param)
  8. await conn.commit()
  9. except:
  10. await conn.rollback()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement