Reputation: 7348
I have been working on an application where I need to determine the primary keys of the table programatically. Is there any API exposed in Android Sqlite which enables us to do this? I was able to find an API for retrieving primary keys of a table in C, but couldn't find the same for Android.
Any leads would be appreciated. TIA.
Upvotes: 1
Views: 75
Reputation: 731
pragma table_info(table_name)
Run this schema (query) and find where pk value is 1
Upvotes: 1