Support pre-commit callback - #99
Merged
Merged
Conversation
mikee47
marked this pull request as draft
August 8, 2026 16:02
mikee47
force-pushed
the
feature/datagen
branch
from
August 9, 2026 09:17
27dba93 to
6f771c9
Compare
mikee47
marked this pull request as ready for review
August 9, 2026 09:20
Open
mikee47
force-pushed
the
feature/datagen
branch
from
August 10, 2026 19:11
ba314c3 to
2f98dbc
Compare
mikee47
force-pushed
the
feature/datagen
branch
from
August 12, 2026 13:59
2f98dbc to
7d4e046
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR provides support for registering callbacks on objects, invoked just before changes are committed. Typically this would be at the end of a streaming import.
Applications call
onCommitto register a callback, which remains active indefinitely. The mechanism is similar to how asynchronous updates are handled, except those are 'one-shot' callbacks.The callback receives an updater instance, and if
clearDirtyis called then the data is never flushed to the filesystem. This can be used to support 'ephemeral' or temporary in-RAM only use.Another use for the callback is to perform extended data validation before data is written to the filesystem. The update can be rejected by calling
clearDirty.Change callbacks are discussed in issue #48. This PR is a partial solution to that but at present there is no indication as to which fields have changed.
TODO: