I'm looking for a framework to utilize to integrate a number of database consistency checking rules into our system. This should basically be a automated test case runner for our database checks.
Requirements:
- Easy to write new rules or checks
- Easy to run all rules, grouping of rule subsets would be a bonus
- Accurate and simple reporting of rules as they are executed or after execution
I'm about to write something like this myself but I thought that I would see if I could find something else out there first. I googled it but couldn't find anything.
Some rule examples:
- Ensure that in a child table for each record with [Rank] N, that N is 0 or there is a record with [Rank] N-1. E.g. child records will always have monotonically increasing ranks from 0 to MAX(Rank) for a given parent.
- Our database uses a global "type/ID" system with a single MasterEntity table that is a header table for every Entity in the system. Each entity type belongs in 1 or more specific Entity tables and each Entity table only allows 1 or more specific types. Check that all entities in the system have correct records in their appropriate entity tables.
- Ensure that all securable types have an entry in our security descriptor table