Skip to content

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
tomhollingworth:main
Open

feat: add --max-levels (with validation) to root command and --memtable-size to info command CLI flags#2259
tomhollingworth wants to merge 3 commits intodgraph-io:mainfrom
tomhollingworth:main

Conversation

@tomhollingworth
Copy link

Description

  • Add persistent --max-levels flag (default 7) to root command, validate it's ≥1
  • Add --memtable-size flag (default 128MB) to info command
  • Change log message formatting in runCompactDef (move mid message newline to end)

Checklist

  • Code compiles correctly and linting passes locally
  • Tests added for new functionality, or regression tests for bug fixes added as applicable

…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.
@CLAassistant
Copy link

CLAassistant commented Feb 11, 2026

CLA assistant check
All committers have signed the CLA.

@tomhollingworth tomhollingworth marked this pull request as ready for review February 11, 2026 21:34
@tomhollingworth tomhollingworth requested a review from a team as a code owner February 11, 2026 21:34
- 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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants