You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Should be able to call model.update({ foo: "bar", baz: null }) and model.destroy(). Both require models to track what row they're in.
To reproduce the behavior of a regular spreadsheet, Model#destroy should remove the entire row. This has the side-effect of changing the row number of every record with a greater row number.
Possible solutions:
Mark deleted record's row as "archived" instead of removing it. Bad: Sheet eventually becomes filled with junk**. Poor usability and performance.
Require a separate, unique, non-null column in every sheet to identify records after rows have been deleted. Bad: Too big a requirement from the user.
Keep every instantiated record in an array, sorted by row number. When a record is deleted, update the row number of all instantiated records that had a greater row number. Bad: Deletion becomes Log(n) + n / 2 operation. Log(n) at worst to find the first instance with a greater row number in the sorted array + n/2 on average to update those rows. Race condition if the user manually changes the sheet while Goodel is running.
Option 3 looks best.
** Not a bad idea to have an "archive" instance method. Opened #8.
The text was updated successfully, but these errors were encountered:
Should be able to call model.update({ foo: "bar", baz: null }) and model.destroy(). Both require models to track what row they're in.
To reproduce the behavior of a regular spreadsheet, Model#destroy should remove the entire row. This has the side-effect of changing the row number of every record with a greater row number.
Possible solutions:
Option 3 looks best.
** Not a bad idea to have an "archive" instance method. Opened #8.
The text was updated successfully, but these errors were encountered: