Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dynamodb-client): add word boundary in regex #251

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joaodfmota
Copy link

What did you implement:

Closes #242

How did you implement it:

Added word boundary /b in exprSegments

How can we verify it:

The following UpdateExpression:
"SET #assets = list_append(if_not_exists(#assets, :empty_list), :assets)"
Throw "Invalid UpdateExpression: Syntax error; token: \",\", near: \"#as, #LambdaPowertoolsContext\""

This happens because exprSegments without word boundaries produces the following result:
["SET", "#as", "set", "s = list_append(if_not_exists(#as", "set", "s, :empty_list), :as", "set", "s)"]

Adding the word boundary produces the expected result:
["SET", "#assets = list_append(if_not_exists(#assets, :empty_list), :assets)"]

Is this ready for review?: YES
Is it a breaking change?: NO

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.

DynamoDB DocumentClient :: Update fails in case attribute name contains keyword ADD
1 participant