Skip to content

feat(mdbx): add read result API#116

Merged
NewYaroslav merged 3 commits into
mainfrom
feat/mdbx-read-result
Jun 1, 2026
Merged

feat(mdbx): add read result API#116
NewYaroslav merged 3 commits into
mainfrom
feat/mdbx-read-result

Conversation

@NewYaroslav

@NewYaroslav NewYaroslav commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • add shared LogReadError and LogReadResult in ILogReader for detailed read outcomes
  • add result-returning range/recent APIs while keeping existing vector-returning wrappers compatible
  • use the shared result type for MdbxLogger payload/session/data-specific read methods
  • expose successful result wrappers from MemoryLogger under the C++17 result API
  • distinguish not found, storage, decode, unsupported version, and decompression failures in MDBX tests
  • include semantic-value guide rules for magic numbers/literals and intention-revealing test data

Verification

  • cmake -S . -B build-mdbx-test -G "MinGW Makefiles" -DLOGIT_CPP_BUILD_TESTS=ON -DLOGIT_WITH_MDBX=ON -DLOGIT_USE_SUBMODULES=ON
  • cmake --build build-mdbx-test --target mdbx_logger_test -j2
  • ctest --test-dir build-mdbx-test -R mdbx_logger_test --output-on-failure
  • git diff --check -- include/logit_cpp/logit/loggers/ILogReader.hpp include/logit_cpp/logit/loggers/MemoryLogger.hpp include/logit_cpp/logit/loggers/MdbxLogger.hpp tests/mdbx_logger_test.cpp guides/cpp_style.md
  • cmake -S . -B build-cxx11-check -G "MinGW Makefiles" -DLOGIT_CPP_BUILD_TESTS=ON -DCMAKE_CXX_STANDARD=11
  • cmake --build build-cxx11-check --target memory_logger_backend_test -j2

🤖 Generated with Claude Code

NewYaroslav and others added 3 commits June 1, 2026 15:21
Expose detailed read failures without changing the existing nullopt/empty-vector compatibility wrappers, so callers can distinguish not-found cases from storage, decode, version, and decompression failures.

Constraint: Keep existing read_payload/read_session/read_range behavior compatible

Rejected: Throwing public read API | would turn current safe reads into a breaking change

Confidence: high

Scope-risk: moderate

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Move the detailed read-result type to ILogReader so MDBX-specific payload/session methods and generic range/recent reads use one result model while MemoryLogger can expose the same successful-read shape.

Constraint: Preserve C++11 MemoryLogger builds with C++17-only result helpers guarded

Confidence: high

Scope-risk: moderate

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Make MdbxLogger's detailed range/recent read methods explicitly override ILogReader so signature drift is caught at compile time.

Constraint: Preserve read result API behavior

Confidence: high

Scope-risk: narrow

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@NewYaroslav NewYaroslav merged commit 60b6382 into main Jun 1, 2026
13 checks passed
@NewYaroslav NewYaroslav deleted the feat/mdbx-read-result branch June 3, 2026 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant