sqlite auto incrementing index

I’m still working on organizing my music, and one thing I decided to do was to put everything in a tiny sqlite database instead of storing it all in XML and shifting arrays around (yuck).  I went to create an auto-incrementing index column in my tables though, and I couldn’t figure it out.

SQLite’s page on the matter says to use INTEGER PRIMARY KEY AUTOINCREMENT, though that order didn’t work for me.  What did work was INTEGER AUTOINCREMENT PRIMARY KEY.  Weird.

And for the record, SQLite is incredibly fast, assuming you are using transactions to insert, delete and update stuff.  Wow.

Leave a Reply