Compares RDS and JSON database files to verify migration accuracy and identify any differences in structure or content.
Value
List of differences, each containing:
path
: Location of difference in database structuretype
: Type of difference (type_mismatch, missing_in_json, missing_in_rds, value_mismatch)Additional fields depending on difference type
Details
This function performs a deep comparison of database structures, checking:
Data types match between formats
All keys/fields are present in both versions
Values are equivalent (accounting for format differences)
Useful for verifying that migration from RDS to JSON preserves all data and structure correctly.
Examples
if (FALSE) { # \dontrun{
# Compare original and migrated databases
differences <- compare_rds_json(
"original/methods_db.rds",
"migrated/methods_db.json"
)
if (length(differences) == 0) {
message("Migration successful - databases are equivalent!")
} else {
# Review differences
for (diff in differences) {
cat(sprintf("Difference at %s: %s\n", diff$path, diff$type))
}
}
} # }