How to get/utilize SQLite row ID reliably with C API when user hide all the column names?

720 Views Asked by At

According to SQLite documentation, All tables have rowid by default, and it cannot be removed. And this rowid can be accessed with rowid, oid or _rowid_.

Anyway database users can add the new column with the names freely, and the columns will be hidden. The only way to access rowid is making a new column with INTEGER PRIMARY KEY.

This is my current understanding. And with this, I have no reliable way to get the rowid if user hide all the columns and user didn't make any PK column. I have thought about adding temporary PK column, but this is unreliable too. If this is true, this doesn't make sense. Because the data is always available, and I just cannot access because there's no appropriate interface.

So I think there should be a way to access this data reliably. But I couldn't find anything with C API. Can I have some guidance for this?

0

There are 0 best solutions below