Skip to content

refactor(transaction): use TypedBuilder and getters for snapshot producer input structs #3619

Open

Description

@CTTY

Is your feature request related to a problem or challenge?

The snapshot producer inputs introduced in #3564 (and the earlier SimpleSnapshotProducer) are plain structs with pub fields built by struct literal:

  • MergingIntent (transaction/snapshot/merging.rs)
  • AppendIntent (transaction/snapshot/simple.rs)
  • SnapshotCommitInput (transaction/snapshot/mod.rs)

Adding a field to any of them touches every construction site, and the style differs from the crate's pub structs, which use typed_builder::TypedBuilder with private fields and getters (e.g. AddColumn in transaction/update_schema.rs). Raised by @blackmwk in #3564 (comment).

Describe the solution you'd like

Derive TypedBuilder on the three structs, make the fields private, and add pub(crate) getters. Optional fields get #[builder(default)]; fail_missing_delete_paths defaults to true. Update the construction sites in append.rs, the two producers, and tests.

AddedManifests and Filtered stay as they are: each is a function result with a single construction site inside its producer, so a builder would add indirection without protecting anything.

Follow-up to #3564; part of #3417.

Willingness to contribute

I can contribute to this feature independently

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions