in reply to Finding the next avaliable id in a SQLite database
That is the best way to do it. If you find the largest value, increment it by one and write a record with it, you will introduce a race condition - and that will bite you when you least expect it (probably once you've gone into production).
|
|---|