Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When soft deleting, preserve previous values if we have them in memory #762

Merged
merged 7 commits into from
Jun 25, 2024

Conversation

danafallon
Copy link
Contributor

Step 1 of not clearing out the values of a row when it's soft deleted.

If a row is updated and then deleted before the next flush, we have its previous values in memory so we can use those and just add the deleted flag.

@@ -131,17 +131,27 @@ func (t *TableData) InsertRow(pk string, rowData map[string]any, delete bool) {
prevRow, isOk := t.rowsData[pk]
if isOk {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(hide whitespace to make the diff simpler)

@danafallon danafallon merged commit 138b5ee into master Jun 25, 2024
1 check passed
@danafallon danafallon deleted the dana/soft-delete-behavior branch June 25, 2024 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants