def build_clause(components, name='', join=','):
    """ Build a string from a list of components.
        This is to simplify building where clauses in particular that
        may optionally have zero, one or more parts
    """
    if not components:
        return ''
    return ' ' + name + ' ' + (' ' + join + ' ').join(components) + ' '
