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

Table Watchdog in MySQL #1658

Open
shahiakhilesh1304 opened this issue Jan 11, 2025 · 0 comments
Open

Table Watchdog in MySQL #1658

shahiakhilesh1304 opened this issue Jan 11, 2025 · 0 comments

Comments

@shahiakhilesh1304
Copy link

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

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

1 participant