Closed 0xraks closed 2 years ago
@0xraks - Are there any errors in cloudwatch related to the SQL rule? DynamoDB throws an error when you combine with other fields. Instead of using , can you try mentioning the fields explicitly?
For example, the below query would throw an error.
SELECT *, "__typename" FROM "Table"
Hi @0xraks Thanks for opening this issue.
Have you enabled conflict detection while configuring the API category for DataStore?
Meta fields such as _lastChangedAt
is added when enabling conflict detection. __typename
is generally a required field working with GraphQL specification. Which cannot be removed.
Have you tried to wrap _lastChangedAt
with double quotes?
Hi @0xraks Thanks for opening this issue.
Have you enabled conflict detection while configuring the API category for DataStore?
Meta fields such as
_lastChangedAt
is added when enabling conflict detection.__typename
is generally a required field working with GraphQL specification. Which cannot be removed.Have you tried to wrap
_lastChangedAt
with double quotes?
Hi @HuiSF , Yes, I've tried the double quotes, but it doesn't help. The IoT core SQL is not allowing me to set an alias with anything beginning with an "-".
So SELECT timestamp() as lastChangedAt
is OK.
But
SELECT timestamp() as _lastChangedAt
is not good and throws the error.
Is there any way I can rename "_lastChangedAt" to something like "last_Changed_At" from the Amplify side?
Is there any way I can rename "_lastChangedAt" to something like "last_Changed_At" from the Amplify side?
Unfortunately, I don't think the conflict detection fields are customizable at this moment.
I used AWS lambdas instead of using IoT-Core rules to insert entries to the DB and now amplify syncs with no Issues. Thanks All!
Description
Dynamo DB that is created by Amplify has the following fields:
Any way I can disable it from creating these?
I'm trying to add data from AWS IoT Core to the DynamoDB with an SQL rule:
SELECT *, (cast(timestamp() as String)) as _lastChangedAt, from 'topic/MQTT'
The problem with this is that the IoT Core SQL Rule to add data from MQTT to the DB does not allow to have an alias to start with an underscore. So the above rule throws an error.
If I add an entry in the DB without "_lastChangedAt" field, Amplify throws an error "Models failed to sync". However, the data sync is working if I add the data item directly from the Amplify Studio and the Android application directly.
Could you please let me know if there is any possible workaround?
Categories
Steps to Reproduce
No response
Screenshots
No response
Platforms
Android Device/Emulator API Level
No response
Environment
Dependencies
Device
Pixel 4XL
OS
Android 12.0
CLI Version
8.4.0
Additional Context
No response