Skip to content

Implement RemoteKV gRPC Client Adapter for SQL Gateway Executor - #43

Merged
theMr17 merged 2 commits into
mainfrom
feat/bridge-kv
Sep 10, 2026
Merged

theMr17 merged 2 commits into
mainfrom
feat/bridge-kv

Conversation

@Souvik606

@Souvik606 Souvik606 commented Sep 9, 2026

Copy link
Copy Markdown
Member

Issue Reference

Fixes #42

Summary by CodeRabbit

  • New Features
    • Added support for interacting with key-value data through a remote storage service.
    • Supports reading, writing, deleting, and batch-updating entries.
    • Added prefix-based scanning with ordered iteration and safe stream cleanup.
    • Missing keys now return a consistent not-found result.
  • Tests
    • Added coverage for standard operations, batch updates, scans, empty results, and missing-key handling.

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: eb0079f9-4282-4149-ab35-6e293e746662

📥 Commits

Reviewing files that changed from the base of the PR and between 3f01808 and 2f84f52.

📒 Files selected for processing (3)
  • internal/bridge/kv/remote.go
  • internal/bridge/kv/remote_iterator.go
  • internal/bridge/kv/remote_test.go

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

Changes

Added a gRPC-backed RemoteKV implementation for remote CRUD, batch writes, and prefix scans. Added a cancellable streaming iterator and end-to-end tests with an in-process storage server.

RemoteKV gRPC adapter

Layer / File(s) Summary
RemoteKV operations
internal/bridge/kv/remote.go
RemoteKV implements remote get, put, delete, batch-write, and gRPC error mapping.
Streaming scan iterator
internal/bridge/kv/remote.go, internal/bridge/kv/remote_iterator.go
Scan creates a cancellable stream. remoteIterator prefetches entries, returns copied key-value pairs, records errors, and closes the stream.
Remote adapter integration tests
internal/bridge/kv/remote_test.go
Tests CRUD operations, batch writes, prefix scans, empty scans, and missing-key errors through an in-process gRPC server.

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant RemoteKV
  participant StorageService
  participant remoteIterator
  Caller->>RemoteKV: Scan(prefix)
  RemoteKV->>StorageService: ScanRequest
  StorageService-->>remoteIterator: Scan response stream
  remoteIterator->>StorageService: Recv()
  remoteIterator-->>Caller: key and value entries
  Caller->>remoteIterator: Close()
  remoteIterator->>StorageService: cancel stream context
Loading

Assessment Against Linked Issues

Objective Addressed Explanation
Implement RemoteKV operations and gRPC error translation [#42]
Implement a cancellable streaming remoteIterator [#42]
Add integration coverage for CRUD, batch writes, scans, empty scans, and error mapping [#42]

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 2f84f

This change adds a gRPC-backed key-value adapter with streaming prefix scans and preserves missing-key behavior through the standard sentinel error. Covered CRUD, batch, scan, and empty-result behavior indicates no remaining merge-blocking risk.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Souvik606

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

CodeRabbit chat interactions are restricted to organization members for this repository. Ask an organization member to interact with CodeRabbit, or set chat.allow_non_org_members: true in your configuration.

@Souvik606

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot changed the title @coderabbitai Implement RemoteKV gRPC Client Adapter for SQL Gateway Executor Sep 9, 2026
@theMr17
theMr17 merged commit c1cbbeb into main Sep 10, 2026
3 checks passed
@theMr17
theMr17 deleted the feat/bridge-kv branch September 10, 2026 11:41
@theMr17

theMr17 commented Sep 10, 2026

Copy link
Copy Markdown
Member

/coverage

@github-actions

Copy link
Copy Markdown

Coverage report (2f84f52)

Packages changed in this PR:

Package Coverage Statements
internal/bridge/kv 87.7% 57/65
TOTAL (PR-affected) 87.7% 57/65
Treemap — by file

coverage treemap by file

Box size = statements per file. Color = coverage heat, red (low) → green (high).

Treemap — by package (with %)

coverage treemap by package

Box size = statements per package. Color = coverage heat, red (low) → green (high).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement RemoteKV gRPC client adapter for SQL Gateway Executor engine

3 participants