-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Add conditional query watcher and convenience methods for update, delete, insert and select queries #359
Conversation
Very nice! Could you also send a PR to our docs (which can be found here: https://github.com/spatie/myray.app/tree/main/docs/php/laravel) |
Looks like I don't have access to that repo @freekmurze. Seem like the improve this page links on https://myray.app/docs/getting-started/introduction are broken as well. |
Just checking in here @freekmurze, I'm happy to write the docs up when possible. |
Could you add docs for this too? Thanks! |
I don't have access to the docs repo you shared @freekmurze, is it available elsewhere? |
Circling back on this @freekmurze, I don't have access to the docs repo you provided. I'm happy to provide docs when possible. |
This piggybacks of the QueryWatcher but only sends queries to ray that satify a conditional callback I've added update here as a helper method.
…ister Poor mans abstraction
This has been rebased, still awaiting permissions to add docs. ❤️ |
Sorry for the long wait time. You'll find the docs here: https://github.com/spatie/myray.app/tree/main/docs |
@freekmurze Added in spatie/myray.app#28 |
Thanks! |
When I'm writing migrations or commands that change a lot of data I often want to see just the write queries, or just the updates or deletes, depending on what the context is. But the queries I want to see are usually amongst 10s to 100s times as many queries that I don't want to see. The execution slows down and Ray struggles to then filter through so many payloads.
This PR allows the user to conditionally send queries based on the query itself, no longer bogging down Ray or littering the UI with pointless queries.
Additionally I have added convenience methods around insert, select, update and delete queries, all of which can be turned on in the config.
SlowQueryWatcher
is a great example of whatConditionalQueryWatcher
can be used for.