开发者

sqlite - programmatically determine primary key(s)

I need to programatically determine what the primary key field(s) are for a given sqlite table (using sqlite api, not command line).

I can get a list of tables and a list of colum开发者_JAVA技巧ns, but only see the column type using the Column_Type() function. Need to know if a given column is the primary key (or part of the primary key if a compound key is used).


Have a look at sqlite3_table_column_metadata:

This routine returns metadata about a specific column of a specific database table accessible using the database connection handle passed as the first function argument.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜