-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Description
Would it be possible to implement a watchdog mechanism in MySQL tables similar to MongoDB's document change streams? With such a feature, a user could set a watchdog to receive acknowledgments whenever an update occurs on a table. This would allow developers to trigger their application logic or proceed with their code only after receiving the update acknowledgment.
Example Use Case
In MongoDB, developers can utilize a watchdog to monitor document changes, and it would be great to achieve similar functionality with MySQL tables.
Example Code
Here’s a conceptual example based on MongoDB's document watchdog:
## Attaching a very low level example.
from pymongo import MongoClient
from pymongo.change_stream import ChangeStream
client = MongoClient('mongodb://localhost:27017/')
db = client['example_db']
collection = db['example_collection']
with collection.watch() as stream:
for change in stream:
print("Change detected:", change)The idea is to have a some what similar implementation or workaround for MySQL tables, allowing developers to monitor and react to table updates efficiently.
Help me to understand what could go wrong if this solution dosen't look good