Re: [sqlite] how would you allow users to re-order rows arbitrarily?

2007-01-08 Thread Dennis Cote
Sean Payne wrote: Suppose gui-users wanted to drag and drop rows in a table so that they could shuffle it anyway that they wanted so that the rows maintained that order the next time they accessed the table. Can this be done without updating alot of other rows? How is this normally handled?

Re: [sqlite] how would you allow users to re-order rows arbitrarily?

2007-01-07 Thread Nicolas Williams
On Sat, Jan 06, 2007 at 09:53:39PM -0800, Sean Payne wrote: > Suppose gui-users wanted to drag and drop rows in a table so that > they could shuffle it anyway that they wanted so that the rows > maintained that order the next time they accessed the table. Can > this be done without

Re: [sqlite] how would you allow users to re-order rows arbitrarily?

2007-01-06 Thread John Stanton
Traditionally that is achieved by a doubly linked list. Each row contains a pointer to the next and previous row and a null for the end case. The linked list structure cannot fail regardless of the amount of shuffling or the size. Sean Payne wrote: Suppose gui-users wanted to drag and drop

Re: [sqlite] how would you allow users to re-order rows arbitrarily?

2007-01-06 Thread Jay Sprenkle
I do it by maintaining a column named 'SortOrder' You can update the field to have whatever content will get you the order you want at the moment and it's preserved the next time they start the application. On 1/6/07, Sean Payne <[EMAIL PROTECTED]> wrote: Suppose gui-users wanted to drag and

[sqlite] how would you allow users to re-order rows arbitrarily?

2007-01-06 Thread Sean Payne
Suppose gui-users wanted to drag and drop rows in a table so that they could shuffle it anyway that they wanted so that the rows maintained that order the next time they accessed the table. Can this be done without updating alot of other rows? How is this normally handled? The ideas I