Skip to content

Query records reader never populates Key().ID — row id only reachable via Data()["id"] #168

Description

@trakhimenok

Found during synchestra pkg/state/replication review (synchestra-io/synchestra PR #15).

getRecordsReader/recordsReader.Next construct every record via dalrecord.NewRecordWithData(dalrecord.NewKeyWithID("Unknown", ""), ...) and only place the row's id into Data()record.Key().ID is always the empty string. dalgo2ingitdb's equivalent query path builds a real dal.NewKeyWithID(collection, recKey) per row, so consumers that need the record key behave differently across the two adapters.

Downstream effect: synchestra's loadOutboxEvents must check both rec.Key().ID and Data()["id"] as a workaround (commented as such, to be removed when this is fixed). Any other consumer doing ExecuteQueryToRecordsReader + Key().ID silently gets "".

Expected: the SQL query reader populates Key().ID (and collection) like dalgo2ingitdb does.

🤖 Generated with Claude Code

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions