moved throwErrorIfNoRowsAffected() function to crud utils and re-used where possible