Use serde to parse data lines and checkpoints #82
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 is another item moved out of #70 with the intention of making that PR easier to review.
This replaces SQL queries to traverse JSON structures with a serde deserialization in two places:
For checkpoints, the implementation has been moved to
src/sync/checkpoint.rs
, the existingcheckpoint.rs
delegates to the new function. The new sync client will also log a bit more information on checksum failures (like the checksum from the checkpoint line and theop_checksum
andadd_checksum
in the database) - I've kept that logic here, which means thatcheckpoint.rs
needs to map back into the simple string representation.Similarly, logic to insert data has moved to
src/sync/operations.rs
with the existing file just delegating to the new function. This shouldn't change behavior at all (the only change is that thesave_data
previously accepted oplog entries wheredata
was a direct JSON object - now it needs to be a JSON-serialized string. I can restore the existing behavior here as well, but my understanding is that all client SDKs have been migrated).