EasyPost / rust-mysql-binlog

Rust implementation of the MySQL binlog format
ISC License
102 stars 18 forks source link

Expose BinlogEvent processing for mysql_async #1

Closed normanrz closed 2 years ago

normanrz commented 4 years ago

I am looking to integrate this binlog event parser with mysql_async. You can read more about that in this issue. I also built a runnable test which is referenced in the issue.

For that, I thought it would be useful to expose a processing function for enriching raw event with the tableMap. Essentially exposing the internal processing of the EventIterator.

If you are interested in this PR, I am happy for work on it further. I could also imagine a simpler API, e.g.

let binlog_stream = BinlogStream::new(conn); // registers a mysql_async connection for binlog events
while let Some(event) = binlog_stream.next().await? {
    println!("got = {}", event); // ready to use BinlogEvent (with TableMap processing)
}

I am sorry that my IDE reformatted all the code. I am happy to clean that up, if you want to proceed with this PR.

Justintime50 commented 2 years ago

Is this still needed? Can you rebase against master?

normanrz commented 2 years ago

I don't think this is needed anymore. There is now integrated support for binlog streams in mysql_async.