In SQLite, I can run the following query to get a list of columns in a table:
PRAGMA table_info(myTable)
This gives me columns, but does not contain information about what primary keys may be. In addition, I can run the following two queries to search for indexes and foreign keys:
PRAGMA index_list(myTable) PRAGMA foreign_key_list(myTable)
But I canβt figure out how to view primary keys. Does anyone know how I can do this?
Note. I also know what I can do:
select * from sqlite_master where type = 'table' and name ='myTable';
And he will give the create table statement, which shows the primary keys. But I'm looking for a way to do this without parsing the create statement.
schema primary-key sqlite3
Kyle
source share