Callback parameter when checking or fixing the tree#536
Open
G3z wants to merge 2 commits intolazychaser:v6from
Open
Callback parameter when checking or fixing the tree#536G3z wants to merge 2 commits intolazychaser:v6from
G3z wants to merge 2 commits intolazychaser:v6from
Conversation
Collaborator
|
@lazychaser It would be great if you could merge one of these PRs (there are a few similar), basically so global scopes are removed (or can be removed) when calling isBroken() or fixTree(). Often global scopes are used for tenanting or other purposes, but when checking or fixing the tree, we want to treat the entire table as one whole, and fix lft and rgt values across all entries in the table. Having an optional query scope passed in, as in this PR, seems like a good approach, as then there's no breaking change to the current default behaviour of the methods. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've added an optional callback to
fixTree()countErrors()and relative methods so a user can configure the queryMy main use case i to disable global scopes (I've added tests for this use case)
usage