Skip to content

feat(#91): add Transaction::getMappedRange() for single-round-trip index lookups - #103

Merged
s2x merged 1 commit into
masterfrom
feat/91-get-mapped-range
Sep 9, 2026
Merged

feat(#91): add Transaction::getMappedRange() for single-round-trip index lookups#103
s2x merged 1 commit into
masterfrom
feat/91-get-mapped-range

Conversation

@s2x

@s2x s2x commented Sep 8, 2026

Copy link
Copy Markdown
Member

Closes #91

Summary

Adds ReadTransaction::getMappedRange() — single-round-trip index lookups backed by fdb_transaction_get_mapped_range / fdb_future_get_mappedkeyvalue_array. Each resolved index row is returned as a MappedKeyValue pairing the index key/value with the records described by the mapper tuple template ({K[N]}, {V[N]}, and the trailing {...} range descriptor).

Notes / findings

  • Mapped ranges work only on non-snapshot (read-your-writes) reads in FDB 7.3 (the issue description had this inverted); calling it on Snapshot throws a LogicException.
  • The public fdb_c.h FDBMappedKeyValue declaration does not model the real reply layout: the native client returns either a point lookup or a range lookup per row (selected by a variant index at offset 104). The FFI layer decodes both alternatives — details in the issue comment.
  • docker/php/Dockerfile now derives the FoundationDB clients deb arch from TARGETARCH (the image previously shipped a mismatched libfdb_c on arm64 builds).

Testing

  • composer lint clean (PHPCS + Rector + PHPStan L9)
  • composer test:unit — 490 tests pass
  • composer test:integration — 239 tests / 813 assertions pass on the 5-node 7.3.75 cluster, including the new MappedRangeTest (7 tests)
  • docs/range-reads.md documents the mapper syntax; CHANGELOG.md updated

@s2x
s2x merged commit 4efaa17 into master Sep 9, 2026
6 checks passed
@s2x
s2x deleted the feat/91-get-mapped-range branch September 9, 2026 05:09
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.

Add Transaction::getMappedRange() for single-round-trip index lookups

1 participant