Skip to content

Commit 0a65ab8

Browse files
committed
add to_json method to BinLogEvent
1 parent fa737ec commit 0a65ab8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pymysqlreplication/event.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ def to_dict(self) -> dict:
8989
"read_bytes": self.packet.read_bytes,
9090
}
9191

92+
def to_json(self) -> str:
93+
return json.dumps(self.to_dict())
94+
9295
def _dump(self):
9396
"""Core data dumped for the event"""
9497
pass

0 commit comments

Comments
 (0)