Why did cdb_set_case() become a mandatory call?

Hi,
I was implementing my southbound set operations via “cdb_set_values()”
And as what I read from the <confd_user_guide>, developers are required to call “cdb_set_case()” explicitly.

One thing bothers me is that when I called “cdb_set_values()” once to set an entry, I might need to call “cdb_set_case()” multiple times.
Takes below yang container for example:

container team {
    list member {
        key name;
        leaf name { type string; }
        leaf age { type uint8; }
        list task {
            key name;
            leaf name { type string; }
            choice task_id {
                leaf third-party { type uint64; }
                leaf internal { type uint64; }
            }
        }
    }
}

If I want to create a “member” with 8 “task”, I have to call “cdb_set_values()” for one time while I need to call “cdb_set_case()” for 8 times.

But from what I observed, if we needed to identify “what case is selected”, all the needed information can be found within the parameters that passed onto the “cdb_set_values()”, i.e. the “confd_tag_value_t” array.

Back to above example, when I call “cdb_set_values()” to give the value to the leaf “third-party” or “internal”. It’s quite obvious that which case ought to be chosen for this choice. And for “case deletion” I think the “SET_NOEXIST” also make sense.

So why do we need it?

Hi,
In your “case” you may want to consider using MAAPI.
See the examples.confd/intro/13-c_stats_push and Facing issue in get_case and set_case for xRAN 1.0.6 yang