Validation engine for databases