Skip to content

refactor(storage): split lib.rs into append, read and write modules #107

Closed

Description

@codecapo

Why

crates/storage/src/lib.rs holds the warehouse type, table lifecycle,
appends, incremental reads, file writing and the shared helpers in one
file of close to 1,000 lines. The replace path from #88 already lives in
its own modules (replace.rs and swap.rs). The rest should follow, so
each module has one reason to change and #89 lands in a small file.

Scope

A move with no change in behaviour or public API:

  • append.rs: append, append_if_head, commit_if_head and the
    head guard.
  • read.rs: read_all, scan_range, read_since, appends_between,
    files_added_by and scan_at.
  • write.rs: write_files and the codec handling.
  • lib.rs keeps the Warehouse type, open_local, table lifecycle,
    the public types and the small shared helpers.
  • Tests move with the code they test.

Done when

  • lib.rs holds only the type, construction, lifecycle and re-exports.
  • Each moved module carries its own tests, and no test is dropped.
  • The public API is unchanged (cargo doc output lists the same items).
  • Coverage stays at or above 95%.

Notes

Land before #89, which changes files_added_by, to keep that diff small.

Activity

  1. added this to the 0.1.0 milestone on Nov 11, 2026
  2. codecapo commented on Nov 12, 2026

    @codecapo
    OwnerAuthor

    Split in #113, stacked on #106. lib.rs keeps types, construction, lifecycle and shared helpers; append.rs, read.rs and write.rs take the rest. Public items unchanged, 26 storage tests kept.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions