Merged
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
simonrw
approved these changes
Jun 13, 2025
Collaborator
simonrw
left a comment
There was a problem hiding this comment.
Thanks for making this improvement!
In general I am not a fan of us writing our own character-to-character SQL generator in this library, so I'd love to hear your thoughts on where we go from here.
| env: | ||
| LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_API_KEY }} | ||
| TEST_IMAGE_NAME: public.ecr.aws/lambda/nodejs:16 | ||
| TEST_IMAGE_NAME: public.ecr.aws/lambda/nodejs:18 |
Collaborator
There was a problem hiding this comment.
Er... we are still using 16 (for better or worse...) https://github.com/localstack/localstack-ext/blob/1f952f304e39d1d066a4d703a2727b395bf8af9e/localstack-pro-core/localstack/pro/core/services/appsync/mapping.py#L25
However we do want to move our JS execution to the node in the container image, so this is a good move, thanks! 👍
| case "notContains": | ||
| return `${startGrouping}${this.quoteChar}${columnName}${this.quoteChar} NOT LIKE ${value}${endGrouping}`; | ||
| case "attributeExists": | ||
| return `${startGrouping}${this.quoteChar}${columnName}${this.quoteChar} IS ${value? "NOT " : ""}NULL${endGrouping}`; |
Collaborator
There was a problem hiding this comment.
I'm not a super fan of this ternary operator, but it's quite common in JS so I'm ok with it.
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.
Motivation
This pr implements support for
attributeExistsin rdswhereclause.The customer sample was also failing as part of the logic in the
whereclause was missing.Changes
attributeExistsor, processandor process a single clause. But only the first of these items would actually make it part of the SQL query.and/orclause. We are callingbuildWhereClauserecursively to correctly build nestedand/orclauses.buildWhereClausenow correctly returns a string. All usage ofbuildWhereClausewere adding it in a string literal. This would create invalid SQL statement if an array is returned.Other fixes along the way
Dateusage in some test, as they would fail in a non UTC environment