feat(dynamodb): add dynamodb storage adapter#206
Open
manueltarouca wants to merge 3 commits into
Open
Conversation
Satont
requested changes
Oct 24, 2023
Member
Satont
left a comment
There was a problem hiding this comment.
Hi.
Thanks for your contribution, really appreciate this.
But can you please do few changes?
| "name": "@grammyjs/storage-dynamodb", | ||
| "version": "2.4.0", | ||
| "description": "AWS DynamoDB storage adapter for grammY", | ||
| "types": "dist/index.d.ts", |
Member
There was a problem hiding this comment.
I think main field missed there?
Comment on lines
+29
to
+31
| if (item) { | ||
| return JSON.parse(item.Value.S) as T; | ||
| } |
Member
There was a problem hiding this comment.
You should response with null in case item not found.
Comment on lines
+32
to
+34
| } catch (error) { | ||
| console.error('Error reading item from DynamoDB:', error); | ||
| } |
Member
There was a problem hiding this comment.
I guess we shouldn't catch something there and especially logging.
| try { | ||
| await this.client.send(putItemCommand); | ||
| } catch (error) { | ||
| console.error('Error writing item to DynamoDB:', error); |
| try { | ||
| await this.client.send(deleteItemCommand); | ||
| } catch (error) { | ||
| console.error('Error deleting item from DynamoDB:', error); |
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.
In this pull request I add an additional storage adapter for DynamoDB.
Let me know if you have questions.
Best regards,
Manuel Tarouca