3 ms·
IMO validating in the DB also makes code faster. When I get data from a well validated DB, I don't have to check that it is valid or has certain formats, that
by tscs37 10y ago
IMO validating in the DB also makes code faster.
When I get data from a well validated DB, I don't have to check that it is valid or has certain formats, that is ensured by the DB.
I can remove checks from the entire CRUD stack, if it's invalid data it does not get created or won't make it into the update.
The easiest way to check data is then to try the INSERT or UDPATE and if it works it's valid.
Otherwise I'd need to validate all fields, see if any contain errors, if any are missing, etc etc.