matrix-org / matrix-rust-sdk

Matrix Client-Server SDK for Rust
Apache License 2.0
1.27k stars 254 forks source link

feat(base) Implement `RelationalLinkedChunk` #4298

Closed Hywan closed 10 hours ago

Hywan commented 5 days ago

A flask of poison

A book floating in space in front of a black hole.


A RelationalLinkedChunk is like a LinkedChunk but with a relational layout, similar to what we would have in a database.

This is used by memory stores. The idea is to have a data layout that is similar for memory stores and for relational database stores, to represent a LinkedChunk.

This type is also designed to receive Update. Applying Updates directly on a LinkedChunk is not ideal and particularly not trivial as the Updates do not match the internal data layout of the LinkedChunk, they have been designed for storages, like a relational database for example.

This type is not as performant as LinkedChunk (in terms of memory layout, CPU caches etc.). It is only designed to be used in memory stores, which are mostly used for test purposes or light usages of the SDK.


codecov[bot] commented 5 days ago

Codecov Report

Attention: Patch coverage is 85.08772% with 17 lines in your changes missing coverage. Please review.

Project coverage is 85.11%. Comparing base (e5ca44b) to head (c788221). Report is 24 commits behind head on main.

Files with missing lines Patch % Lines
...s/matrix-sdk-common/src/linked_chunk/relational.rs 87.35% 11 Missing :warning:
...rix-sdk-base/src/event_cache/store/memory_store.rs 83.33% 3 Missing :warning:
crates/matrix-sdk-common/src/linked_chunk/mod.rs 66.66% 2 Missing :warning:
...es/matrix-sdk-base/src/event_cache/store/traits.rs 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #4298 +/- ## ========================================== + Coverage 85.09% 85.11% +0.01% ========================================== Files 274 275 +1 Lines 30183 30280 +97 ========================================== + Hits 25684 25772 +88 - Misses 4499 4508 +9 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features: