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

Fix field names with special characters in where conditions #812

Conversation

andrykonchin
Copy link
Member

Fix using fields with special characters in where conditions. It's a regression introduced in #655 (v3.10.0).

Examples:

User.where(_sortKey: 'a')
User.where('last:name': 'a')

Errors:

Invalid KeyConditionExpression: Syntax error; token: "_", near: "AND _sortKey"
Invalid FilterExpression: Syntax error; token: ":name", near: "last:name ="

The following characters are considered special in attribute names (according to the DynamoDB documentation) - :, #, ., -.

The dot (.) still is not supported by Dynamoid in where conditions.

Close #808

@andrykonchin andrykonchin merged commit 605e0a0 into master Oct 5, 2024
57 of 58 checks passed
@andrykonchin andrykonchin deleted the ak/use-placeholders-for-every-attribute-in-where-condition branch October 5, 2024 20:53
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.

Error querying fields starting with special characters
1 participant