How can I, in this code, take the data that has been changed in MYSQL and return it in another function?
For example, take the id_ticket column and use it in another function.
const instance = new MySQLEvents(connection, {
startAtEnd: true
});
await instance.start();
instance.addTrigger({
name: 'monitoring all statments',
expression: config.MYSQL_DATABASE+'.ticket.*',
statement: MySQLEvents.STATEMENTS.ALL,
onEvent: e => {
//Take column "id_ticket"
}
});
instance.on(MySQLEvents.EVENTS.CONNECTION_ERROR, console.error);
instance.on(MySQLEvents.EVENTS.ZONGJI_ERROR, console.error);
};
function idticket(//take "id_ticket" from event){
}
question from:
https://stackoverflow.com/questions/65904258/check-for-changes-in-mysql-node-js 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…