def set_max_size_of_cache(connection: 'Connection', cache_size_limit: int
    ) ->None:
    """
    Set the upper limit set in FlowDB for the cache size, in bytes.

    Parameters
    ----------
    connection : "Connection"
    cache_size_limit : int
        Size in bytes to set as the cache limit

    """
    sql = (
        f"UPDATE cache.cache_config SET value='{int(cache_size_limit)}' WHERE key='cache_size'"
        )
    with connection.engine.begin() as trans:
        trans.execute(sql)
