feat: add --max-levels (with validation) to root command and --memtable-size to info command CLI flags#2259
Open
tomhollingworth wants to merge 3 commits intodgraph-io:mainfrom
Open
feat: add --max-levels (with validation) to root command and --memtable-size to info command CLI flags#2259tomhollingworth wants to merge 3 commits intodgraph-io:mainfrom
tomhollingworth wants to merge 3 commits intodgraph-io:mainfrom
Conversation
…le-size to info command CLI flags - Add persistent `--max-levels` flag (default 7) to root command, validate it's ≥1 - Add `--memtable-size` flag (default 128MB) to info command - Use `--max-levels` in commands via `WithMaxLevels` - Use `--memtable-size` in info command via `WithMemTableSize` - Fix log message formatting in `runCompactDef` (remove mid message newline to end)
This commit adds a unit test for the --max-levels CLI flag to ensure it properly validates input. The test verifies that values ≤ 0 are rejected with an appropriate error message, and valid values (e.g., 10) allow the database to open successfully.
- Enhanced temporary directory cleanup in TestMaxLevelsFlag to fail the test if `os.RemoveAll` returns an error, ensuring test reliability and earlier error detection. - Minor formatting fix in root.go (trailing whitespace removal).
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.
Description
--max-levelsflag (default 7) to root command, validate it's ≥1--memtable-sizeflag (default 128MB) to info commandrunCompactDef(move mid message newline to end)Checklist