rust_mysql_common
rust_mysql_common copied to clipboard
get JSON representation of binlog's WriteRowsEvent
Hello :)
I'm trying to push mysql binlog events into a postgres table (weird, I know :)). To do that I'd like to get a JSON representation of the before and after values.
Here is the current code: https://github.com/docteurklein/pgpim/blob/master/rust/src/main.rs#L74 Any idea how to do that? I wonder if impl TryFrom<BinlogRow> for Row would do the trick, since Row seems to be serializable in json? If so, how would you use this API?
Thanks for reading :)
Hi.
It's unclear which layout will be convenient. I'd suggest you to write your own to_json and from_json functions.
Thanks for the fast answer :) I'm quite inexperienced in rust, any hint or example to point me to?