touchstone icon indicating copy to clipboard operation
touchstone copied to clipboard

MySQL actual field values

Open ScottFreeCode opened this issue 4 years ago • 3 comments

Some mocks provide an indication of the actual data, e.g. rabbit's list of published messages. MySQL one cannot tell from the Touchstone failure whether a field didn't match and if so which, vs if there are no records.

Could MySQL be updated to query against the primary keys (preferably just looking those up automatically) and compare the fields?

(Arguably related to #38 which is seeing expected field values)

ScottFreeCode avatar Oct 28 '21 21:10 ScottFreeCode

I may be misunderstanding, but unless the primary key is hard-coded into the test, I'm not sure how Touchstone would know which primary key to use for the query

shanejansen avatar Nov 02 '21 02:11 shanejansen

As far as I know each DB has a non-standardized view or entity you can query for that kind of metadata. First thing that comes up on googling: https://stackoverflow.com/questions/12379221/sql-query-to-find-primary-key-of-a-table

ScottFreeCode avatar Nov 02 '21 21:11 ScottFreeCode

If the primary key match doesn't pull up any records at all, it would be cool to instead get a list of all the records in that table displayed in the same "expected value not in actual list" format as Rabbit payload assertion failures.

ScottFreeCode avatar Sep 15 '22 22:09 ScottFreeCode