Implements optional database validation