This function compares the data in the `DB` object (new data) with the previous or reference data to identify differences. It returns a list of differences for upload. The function ensures that the new data matches the structure defined by the metadata and provides warnings when discrepancies are found.
Details
The function compares the data in `DB$data_update` (new data) with the current data in the database (`DB$data`). If the form names in the new data do not match the `DB$metadata$forms$form_name`, a warning is issued. The function goes through each table in the new data and compares it with the old data, recording the differences.
The `compare` and `to` parameters allow users to specify specific data choices to compare, though their exact usage will depend on how the function is fully implemented.