feat: Add protected setDocClient method to DynamoDbChatStorage#367
Open
yilinglu wants to merge 1 commit into2FastLabs:mainfrom
Open
feat: Add protected setDocClient method to DynamoDbChatStorage#367yilinglu wants to merge 1 commit into2FastLabs:mainfrom
yilinglu wants to merge 1 commit into2FastLabs:mainfrom
Conversation
- Allows subclasses to customize the DynamoDB Document Client - Useful for local development, testing, or custom endpoint configurations - Maintains backward compatibility as a non-breaking change - Includes comprehensive unit tests This enhancement enables common use cases like: - Local development with DynamoDB Local - Testing with mocked clients - Using DynamoDB-compatible services (LocalStack, ScyllaDB) - Custom endpoint configurations
Sancho869
approved these changes
Aug 1, 2025
Collaborator
|
Hi, |
brnaba-aws
reviewed
Oct 8, 2025
| * @param client - The DynamoDBDocumentClient to use | ||
| * @protected | ||
| */ | ||
| protected setDocClient(client: DynamoDBDocumentClient): void { |
Collaborator
There was a problem hiding this comment.
just add an endpoint parameter to avoid such method
brnaba-aws
reviewed
Oct 8, 2025
Collaborator
brnaba-aws
left a comment
There was a problem hiding this comment.
Please, add a new parameter: endpoint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue Link (REQUIRED)
Fixes #368
Summary
Changes
Added a protected
setDocClientmethod to theDynamoDbChatStorageclass, allowing subclasses to customize the DynamoDB Document Client configuration. This enhancement enables common use cases without requiring code duplication.Key benefit: This change enables developers to use DynamoDB Local in Docker containers for local development, eliminating the need for AWS credentials and costs during development.
User experience
Before: Users had to duplicate the entire DynamoDbChatStorage class (~200+ lines) or use type casting hacks to customize the DynamoDB client for local development or testing.
After: Users can cleanly extend DynamoDbChatStorage with minimal code:
Example: Local Development with DynamoDB in Docker
Checklist
Is this a breaking change?
No, this is a non-breaking change. The new protected method is additive and all existing code continues to work unchanged.
RFC issue number: N/A
Checklist:
Testing
Documentation
Added JSDoc documentation for the new method explaining its purpose and usage.
Real-World Benefits
This change significantly improves the developer experience by enabling:
Example docker-compose.yml:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.