“Diffing” objects from a relational database

后端 未结 12 1251
遇见更好的自我
遇见更好的自我 2021-02-04 15:05

Our win32 application assembles objects from the data in a number of tables in a MySQL relational database. Of such an object, multiple revisions are stored in the database.

12条回答
  •  情深已故
    2021-02-04 15:23

    Just an idea, but would it be worthwhile for you to convert the two object versions being compared to some text format and then comparing these text objects using an existing diff program - like diff for example? There are lots of nice diff programs out there that can offer nice visual representations, etc.

    So for example

    Text version of Object 1:

    first_name: Harry
    last_name: Lime
    address: Wien
    version: 0.1
    

    Text version of Object 2:

    first_name: Harry
    last_name: Lime
    address: Vienna
    version: 0.2
    

    The diff would be something like:

    3,4c3,4
    < address: Wien
    < version: 0.1
    ---
    > address: Vienna
    > version: 0.2
    

提交回复
热议问题