How to return a string during conflict insertion?
async with self.db.acquire() as conn: values = { 'phone': phone, 'parent': parent, 'username': '%s@%s' % (phone, parent) } query = insert(db.user).values( **values ).on_conflict_do_nothing( constraint='unique_parent_phone' ).returning( *[sa.column(i) for i in values.keys()] ) ret = await conn.execute(query) When I first insert, I get the line added. If there is already such a line, I don’t get anything in return.
on_conflict_do_nothingmethod (to do nothing on a conflict) in the query what does it do? - microcoder