Re:Database IDs Have No Place in URIs (2008)
by TeMPOraL on Friday May 10, 2019 @09:45AM
(#19877601)
Few days ago I discovered that SQLite has ROWID too; the extra column gets created if your table doesn't have an INTEGER PRIMARY KEY and doesn't declare WITHOUT ROWID. Caveats apply, though. See: https://www.sqlite.org/rowidtable.html.
Re:Database IDs Have No Place in URIs (2008)
by Zancarius on Friday May 10, 2019 @05:01PM
(#19882191)
Funny timing. I just discovered the same about 3 days ago, too. I've been a consumer of SQLite databases but never had much of a need to create one. I was somewhat surprised to say the least. Interestingly, it appears AUTOINCREMENT changes ROWID's behavior [1] to stop ID roll over and reuse.
Apparently you can't use AUTOINCREMENT on tables using WITHOUT ROWID either.
(I know this because I once had to fix a database table with no primary key, and some rows where every field was identical. The rowid lets you delete one out of two identical rows. So it's not an entirely useless feature)
If you had an inexperienced developer, and no-one reviewing their work, and they heard the rowid is the fastest way of looking up a row - faster even than the primary key - so they decided to use that in URLs, that would be tremendously inconvenient.