-
Notifications
You must be signed in to change notification settings - Fork 86
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 reset functionality on the Select class #95
Conversation
I am good with this. Thank you. |
@pmjones, thanks for having moved so fast on this topic. I would of course happy to see this PR merged in a release, that would let me remove these awful Reflection* instances I had to use to achieve the very same thing :) On the other hand, in the PR I made, I took care of allowing to also reset parts from Delete and Update queries. I'm not 100% sure this would as useful as for Select, anyway, from a API consistency point of view, I think that would have been a good thing: if you can reset "where" on Select, why not on "update"? |
I think you have a valid point. I see there are 2 options:
for 1. there probably need be some examples for users of package to understand the use cases of the allowed reset functions. One counter argument for 2: most users, most project may never need to reset part of update+delete query builder object -- the reason is that these 2 only needs to execute once, business logics are normally consolidated first before being used for query builder. Therefore reset is unlikely to happen for them. |
@gauthier I too find it easy to imagine that users may want to reset parts of an INSERT or UPDATE; however, I have a hard time imagining exactly why they will want to do the reset. (I have not, myself, ever had the need.) @yespire Of the new reset() functions on SELECT, only about half of them have been asked-for (especially resetCols(), so we can re-use a query to get a row-count). The resetTables() method, for example, has not been requested anywhere. Perhaps removing, or even just making protected, the methods that have not been asked-for elsewhere is the right thing. Further thoughts? |
(FWIW it seems like only |
Looking good. Is it possible to make a release soon? ... would be really handy for mysql 5.7 with sql_mode=only_full_group_by and generic paginator code that can take an Aura Select |
MySQL chokes if you have an |
@compwright |
@compwright cool. I missed :) . Thanks for your thoughts. |
@pmjones could you merge this and make a release? |
@pmjones any reason you have not removed the branch ? |
Deleting the branch. |
@yespire @golgote @gauthier @harikt --
This PR is based on #84 from @yespire. It combines the resetFrom(), resetFromKey(), and resetTableRefs() into a single resetTables() method, and adds resetBindValues() and resetUnions(). It removes resetLimit(), resetOffset(), resetPage(), because those values are accessible through existing limit(), offset(), and page() methods. Finally, the resetFlags() method is made public instead of protected, and now returns $this.
In summary, the newly-public reset methods are:
Thoughts?