def METHOD_NAME(batch_size, offset):
    return f"""
        INSERT INTO artifact (task_run_state_id, task_run_id, data)
        SELECT id, task_run_id, data
        FROM task_run_state
        WHERE has_data IS TRUE
        ORDER BY id
        LIMIT {batch_size} OFFSET {offset};
    """