Skip to content
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

get JSON representation of binlog's WriteRowsEvent #65

Open
docteurklein opened this issue Jun 16, 2022 · 2 comments
Open

get JSON representation of binlog's WriteRowsEvent #65

docteurklein opened this issue Jun 16, 2022 · 2 comments

Comments

@docteurklein
Copy link

docteurklein commented Jun 16, 2022

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 :)

@blackbeam
Copy link
Owner

Hi.

It's unclear which layout will be convenient. I'd suggest you to write your own to_json and from_json functions.

@docteurklein
Copy link
Author

Thanks for the fast answer :) I'm quite inexperienced in rust, any hint or example to point me to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants