Robotframework-Database-Library icon indicating copy to clipboard operation
Robotframework-Database-Library copied to clipboard

New keyword "Compare Query Results"

Open amochin opened this issue 1 month ago • 0 comments

The keyword should compare results of two SQL queries and show the difference.

The arguments would be like query_1, query_2 and assert_results_equal (True or False). If False, there is no assertion - just show print the difference in the RF log.

Both queries must deliver the same columns - same numbers and the same names. It has to be implemented in the queries themselves.

The output should look like a merged table

  • The columns are the same, they're merged (no duplicated cols like Col_A_Query_1 and Col_A_Query_2 - just Col_A).
  • The cells with not equal values should get a red background and contain both values like Value 1 != Value 2.
  • The column name and the row number with a cell with unequal values shall be highlighted as well.
  • And maybe keep them visible during the scrolling (sticky scroll)?
  • All other cells with equal values should be either not highlighted at all or get a green background maybe.

Apart from the visual highlighting, there should be an assertion to provide the keyword status and the error message

  • The error message should not include all details, but maybe a number of rows and column names? Like this: X rows had differences in cols A, B and C?

The very first check though should be the comparison of row number in results

  • If they are unequal, there should be an error message (without details) - and an additional visual output.
  • Visually, it would be maybe nice to print both tables aside and highlight rows, which exist in one of the results only - in green and red, like git merge style?
  • No further assertions are performed in this case.

amochin avatar Nov 30 '25 13:11 amochin