On 2015-05-20 09:36 PM, Scott Doctor wrote:
>
> Given a field that is a primary key with auto-increment, does sqlite 
> store an integer that gets incremented, or does it look at the last 
> row and increment its value?
>

SQLite stores an Integer that gets incremented if the PK is declared 
specifically with "PRIMARY KEY AUTOINCREMENT", the place it stores the 
integer is a table that you can edit but cannot create or drop, the 
table is called "sqlite_sequence" and it contains an entry for each 
table with an auto-incremented PK (and remain absent until such a table 
is created).

More about that here:
https://www.sqlite.org/autoinc.html



> ------------
> Scott Doctor
> scott at scottdoctor.com
>
> On 5/20/2015 11:05 AM, Simon Slavin wrote:
>> Posting this not because I agree with it but because the subject has 
>> come up here a couple of times.
>>
>> <https://www.clever-cloud.com/blog/engineering/2015/05/20/Why-Auto-Increment-Is-A-Terrible-Idea/>
>>  
>>
>>
>> "Today, I?ll talk about why we stopped using serial integers for our 
>> primary keys, and why we?re now extensively using Universally Unique 
>> IDs (or UUIDs) almost everywhere."
>>
>> Simon.
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users at mailinglists.sqlite.org
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to