Skip to content

Consolidate local FS adapters: dalgo2fsingitdb vs dalgo2ingitdb (duplicated commit logic) #72

@trakhimenok

Description

@trakhimenok

Background

The repo has two local-filesystem dalgo backends:

  • dalgo2fsingitdb — the backend the CLI actually wires in production (cmd/ingitdb/main.godalgo2fsingitdb.NewLocalDBWithDef).
  • dalgo2ingitdb — described in its own code as the concurrent-safe sibling driver (gofrs/flock file locking). Not currently used by the CLI.

Why this issue

PR #71 (transaction message → git commit message) had to add the same opt-in, git-repo-gated commit-on-transaction behavior to both adapters so the CLI path (fsingitdb) actually commits:

  • pkg/dalgo2ingitdb/RunReadwriteTransaction commits tx-written files when a message is set.
  • pkg/dalgo2fsingitdb/ — mirrors it, reusing the shared dalgo2ingitdb.GitCommitPaths helper.

The git-commit helper is shared (not duplicated), but the write-tracking + commit wiring now exists in two places. Maintaining two local FS adapters means new features and bug fixes risk being applied to only one.

Proposal

Decide the long-term direction for the local FS backend and consolidate:

  • If dalgo2ingitdb (concurrent-safe) is the intended future, migrate the CLI's newDB wiring to it and deprecate/remove dalgo2fsingitdb once feature parity is confirmed.
  • Otherwise, document why both exist and which one owns which capability, to avoid divergence.

Acceptance criteria (suggested)

  • A decision recorded on whether dalgo2fsingitdb or dalgo2ingitdb is the canonical local backend.
  • CLI wired to a single local backend (or an explicit, documented reason for keeping both).
  • Commit-on-transaction + write-tracking logic lives in one place.
  • No behavioral regression in the write verbs (insert/update/delete) or the --message/-m flag.

References

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions