RE: [sqlite] ring buffer table

2005-12-24 Thread Richard B. Boulton
ES('Stuff 17'); INSERT INTO ring_buffer (stuff) VALUES('Stuff 18'); INSERT INTO ring_buffer (stuff) VALUES('Stuff 19'); INSERT INTO ring_buffer (stuff) VALUES('Stuff 20'); INSERT INTO ring_buffer (stuff) VALUES('Stuff 21'); SELECT * FROM ring_buffer; 11

RE: [sqlite] ring buffer table

2005-12-24 Thread Richard B. Boulton
oops, just realised that doesn't work when you get further than 10. > -Original Message- > From: Richard B. Boulton [mailto:[EMAIL PROTECTED] > Sent: 24 December 2005 10:37 > To: sqlite-users@sqlite.org > Subject: RE: [sqlite] ring buffer table > > > If yo

RE: [sqlite] ring buffer table

2005-12-24 Thread Richard B. Boulton
If you used an INTEGER PRIMARY KEY AUTOINCREMENT could you use a simple trigger and a modulus of the newly inserted rowid? e.g. for a dimension of 10: CREATE TABLE ring_buffer (key INTEGER PRIMARY KEY AUTOINCREMENT, stuff TEXT); CREATE TRIGGER delete_tail AFTER INSERT ON ring_buffer BEGIN DELE