-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
old row new row, urgent #30
Comments
you just simply need to traverse the log by calling the right event and traverse the array "e.affectedRows['0']" remember if you have "startAtEnd: true" flag set to true you will not see the output until you actually trigger an event , if you want to view all existing events so that you can debug and traverse without triggering an event set it to false
|
My problem is similar to CrazyBunnyz's |
@felippelmartins Hi. Does this problem resolved? |
i would like to get old row and new row like https://www.npmjs.com/package/mysql-events. right now all i got is IntVar {
timestamp: 1604743109000,
nextPosition: 4795,
size: 9,
type: 2,
value: 17,
binlogName: 'mysql-bin.000001'
} basically i want more detail. can you help me ?
and it doesnt detect update too. here is my code
const mysql = require('mysql');
const MySQLEvents = require('@rodrigogs/mysql-events');
const program = async () => {
const connection = mysql.createConnection({
host: 'localhost',
user: 'root',
password: '',
database: 'sociominer'
});
const instance = new MySQLEvents(connection, {
startAtEnd: true,
excludedSchemas: {
mysql: true,
},
});
await instance.start();
instance.addTrigger({
name: 'TEST',
expression: '*',
statement: MySQLEvents.STATEMENTS.ALL,
onEvent: (event) => {
console.log(event); // { type, schema, table, affectedRows: [], affectedColumns: [], timestamp, }
},
});
instance.on(MySQLEvents.EVENTS.CONNECTION_ERROR, console.error);
instance.on(MySQLEvents.EVENTS.ZONGJI_ERROR, console.error);
};
program()
.then(() => console.log('Waiting for database events...'))
.catch(console.error);
and db
i just want to see if there are insert update delete event from test table ( only test table ) and coresponding old row and new row
and what about if i want to listen specificly to certain table only cause currently i listen to al table. already try expression: '*.test', but no event comming instead ( no event )
note : i never and dont want to use schema if possible
my aim is really similar to this https://github.com/kuroski/mysql-events-ui/blob/master/server.js except i need to know which table and row inserted and updated so i know which client shoud i emitted to. especially on insert and update
The text was updated successfully, but these errors were encountered: