message=Error in querying the model., cause=android.database.sqlite.SQLiteException: ambiguous column name: id (code 1 SQLITE_ERROR)
See original GitHub issueThis is my schema ↓↓↓
type User @model {
id: ID!
password: String!
card: [Card] @connection(name: "createdUser")
}
type Card @model {
id: ID!
user: User @connection(name: "createdUser")
date: AWSDateTime!
category: Int!
goalItem: Int
goalValue: Float
achieve: Float
reaction: [Reaction] @connection(name: "getReaction")
}
type Reaction @model {
id: ID!
card: Card @connection(name: "getReaction")
category: Int!
item: Int
}
When I used the ID of card as a predicate, there is an error. ↓↓
When I use another field for the predicate, eg. User
of Card
as a keyword, there is no problem:
I don’t know why. Who can help me?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Sqlite : ambiguous column name - Stack Overflow
I'm a newbie and i try to do that on my database. SELECT id FROM import a INNER ...
Read more >How to Solve the “Ambiguous Name Column” Error in SQL
There are various ways to solve the “ambiguous name column” bug. One of the simplest ways to solve it is explained below.
Read more >Why Is This Name Ambiguous? - ADocLib
messageError in querying the model. causeandroid.database.sqlite.SQLiteException: ambiguous column name: id code 1 SQLITEERROR #908.
Read more >Ambiguous 'ambiguous error', is it normal or bug? - SQLite Forum
SELECT * FROM t a JOIN t b ORDER BY s;. You first get a full dataset (or however it is named internally)...
Read more >What does the SQL 'ambiguous column name' error mean?
Ambiguous error means that you are calling a certain field in which exist in both Table and the SQL has no idea where...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The codegen changes are now live with amplify-codegen@2.22.1.
Use the latest version of Amplify CLI (currently on v4.45.0) to use enhanced model fields. Note that you have to update your Amplify Android library version to at least v1.16.11 (currently on v1.17.0) to be able to use this feature.
Now instead of
field("Activity_id").eq("123")
, you can directly use the static field from your classes like this:Activity.ID.eq("123")
.Hi @upachecog, as you noted, there was a regression in 1.6.10, which broke the workaround which you had in place. This regression has been fixed in the latest version, 1.16.11, so please give it a try and let us know if it is resolved for you.
Additionally, we are in the process of making some further changes so that the workaround won’t be required at all. Instead, you will be able to do something like this: