Generate an optionally URL-quoted unique identifier
        for a row from its primary keys.

def path_from_row_pks(row, pks, use_rowid, quote=True):
    """ Generate an optionally URL-quoted unique identifier
        for a row from its primary keys."""
    if use_rowid:
        bits = [row['rowid']]
    else:
        bits = [
            row[pk]["value"] if isinstance(row[pk], dict) else row[pk]
            for pk in pks
        ]
    if quote:
        bits = [urllib.parse.quote_plus(str(bit)) for bit in bits]
    else:
        bits = [str(bit) for bit in bits]

    return ','.join(bits)