Open saqib-github-work opened 5 months ago
Hi @saqib-github-work, our team members will investigate the issue. We appreciate your patience.
Hi @saqib-github-work ,
Thank you for reporting this issue.
I noticed that you were passing emptyList()
to ObserveQueryOptions
. If your intention was not to sort the output, then you should simply pass null
value for that parameter. Otherwise, please specify whether you want the list to be in ASCENDING or DESCENDING order.
In this context, passing an empty list to ObserveQueryOptions
led the statement generator to assume that an order was specified when, in fact, there was nothing passed. Therefore, you see a blank after ORDER BY
, which invalidates the entire SQL statement.
Please let us know if this addresses your concerns.
Before opening, please confirm:
Language and Async Model
Kotlin - Coroutines
Amplify Categories
DataStore
Gradle script dependencies
Environment information
Please include any relevant guides or documentation you're referencing
https://docs.amplify.aws/android/build-a-backend/more-features/datastore/relational-models/
Describe the bug
I have relational DataModels and creating a subscriptions in the code using observeQuery API providing QueryPredicate to listen to the data updates.
I am experimenting with the DataModels (Post and Comments ) provided in the official documentations.
Exception thrown
DataStoreException{message=Error in querying the model., cause=DataStoreException{message=Invalid SQL statement: SELECT
Comment
.id
ASComment_id
,Comment
.content
ASComment_content
,Comment
.createdAt
ASComment_createdAt
,Comment
.updatedAt
ASComment_updatedAt
,Comment
.postID
ASComment_postID
,Post
.id
ASPost_id
,Post
.content
ASPost_content
,Post
.createdAt
ASPost_createdAt
,Post
.rating
ASPost_rating
,Post
.status
ASPost_status
,Post
.title
ASPost_title
,Post
.updatedAt
ASPost_updatedAt
FROMComment
INNER JOINPost
ONComment
.postID
=Post
.id
WHEREComment
.postID
= ? ORDER BY ;, cause=android.database.sqlite.SQLiteException: near ";": syntax error (code 1 SQLITE_ERROR): , while compiling: SELECTComment
.id
ASComment_id
,Comment
.content
ASComment_content
,Comment
.createdAt
ASComment_createdAt
,Comment
.updatedAt
ASComment_updatedAt
,Comment
.postID
ASComment_postID
,Post
.id
ASPost_id
,Post
.content
ASPost_content
,Post
.createdAt
ASPost_createdAt
,Post
.rating
ASPost_rating
,Post
.status
ASPost_status
,Post
.title
ASPost_title
,Post
.updatedAt
ASPost_updatedAt
FROMComment
INNER JOINPost
ONComment
.postID
=Post
.id
WHEREComment
.postID
= ? ORDER BY ;, recoverySuggestion=There is a possibility that there is a bug if this error persists. Please take a look atReproduction steps (if applicable)
No response
Code Snippet
Log output
amplifyconfiguration.json
No response
GraphQL Schema
Additional information and screenshots
No response