I need to compare 2 databases on their datas. But I have to compare only the data, not the keys, which may be different (but the relations between objets must be the same).
Actually it is a need to verify the proper functioning of a data conversion tool.
Simple example:
I use an entity-framework on C# .Net and Sqlite, here's the database schema:
public partial class Document
{
[PrimaryKey, AutoIncrement]
public Int64 idDocument { get; set; }
public string name { get; set; }
}
public partial class Diagram
{
[PrimaryKey, AutoIncrement]
public Int64 idDiagram { get; set; }
public string title { get; set; }
}
public partial class Document_contains_diagram
{
public Int64 idDocument { get; set; }
public Int64 idDiagram { get; set; }
}
The database :
Tables in order : Document - Diagram - Document_contains_diagram
idDocument | name | idDiagram | title | idDocument | idDiagram | ||
---|---|---|---|---|---|---|---|
1 | "myFirstDocument" | 1 | "evolution" | 1 | 1 | ||
2 | "mySecondDocument" | 2 | "futur" | 2 | 2 |
Should be considered as same as:
idDocument | name | idDiagram | title | idDocument | idDiagram | ||
---|---|---|---|---|---|---|---|
3 | "myFirstDocument" | 8 | "evolution" | 3 | 8 | ||
4 | "mySecondDocument" | 6 | "futur" | 4 | 6 |
It's an example, the true database I want to compare contains more than 50 tables and often more than 10000 entries (RAM limit is a contraint too).
So I'm looking for an generic algorythm, or a tool to compare theses 2 databases that might help me in my search. All tools I've seen only check for strict equality of the tables. Maybe converting the database into a graph would works ?