'List distinct metadata values for show_tag, possibly
filtered by matching match_tag to match_term.'

def cmd_list(self, conn, show_tag, *kv):

    (show_tag_canon, show_key) = self._tagtype_lookup(show_tag)
    query = self._metadata_query(dbcore.query.MatchQuery, None, kv)
    (clause, subvals) = query.clause()
    statement = ((((('SELECT    DISTINCT    ' + show_key) + '    FROM    items    WHERE    ') + clause) + '    ORDER    BY    ') + show_key)
    with self.lib.transaction() as tx:
        rows = tx.query(statement, subvals)
    for row in rows:
        (yield ((show_tag_canon + u':    ') + six.text_type(row[0])))
