-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
modify client request and response #1378
Comments
Hey @ewan9hu, thanks for your interest in the go-mysql-server project! Can you share more specific details about what you're looking to accomplish? Are you just looking for hook that gives you access to a request before it gets processed and/or a result before it gets returned? Let us know if you can share some more specific details with us and we'll see if we can help figure out a good way to accomplish it. |
@fulghum thank you for your reply! Yes, that's exactly what I want to do, I want to get the results of the request and response, and modify them before returning |
That seems like it could be a generally useful hook depending on how it was designed. I'm not aware of anything we have currently that provides that today. We'd potentially be open for a contribution here, but there are a few interesting design choices around the interface that we'd want to discuss ahead of time and get agreement on. The biggest that come to mind is the representation of the query and results. Working from a query as a text string would be an easy interface to expose; using the plan tree nodes could be more powerful, but seems much more fragile and difficult to work with. Some sort of callback function for processing each returned @zachmu – is this something you've thought through before? Any existing hook like this? |
I think a good starting point is a hook for the initial query string. How can this be helpful? |
A hook that works on the incoming query string seems like a reasonable place to start. This likely won't be a high priority change for us to take on directly, but if you or anyone else is interested in sending a contribution, we'd be happy to consider it. |
I can work on it, I already think it has to be part of the /server/handler.go in the early stages of the doQuery() function. |
I suggest it is added to the Event Servers |
Hey @ywadi, I chatted with the team and I think we've got an even easier approach for you... The Vitess project is what provides our SQL grammar/parser as well as the MySQL wire communication protocol implementation. If you check out the Our implementation of Vitess' You could create your own Give that a shot and see what you think. That should give you what you're looking for, and will require much fewer changes and design decisions, so should get you what you're looking for faster, too. |
How to modify result and request of a database query for a client in a MySQL protocolo
The text was updated successfully, but these errors were encountered: