This is a simple version of the code you want. I would start testing from there. You will need to figure out what you mean by the change so that you can give the correct SqlAlchemy event the type of change you are making.
User database after insert listen event
from sqlalchemy import event from app import socketio def after_insert_listener(mapper, connection, target): socketio.emit('namespace response',{'data': data[0]}, namespace='/namespace') print(target.id_user) event.listen(User, 'after_insert', after_insert_listener)
Socketio
source share