How can I get the default CF_handle by C API?
I use RocksDB in C. Now I need to multi_get a list of keys, there are two C API: rocksdb_multi_get and rocksdb_batched_multi_get_cf, notes tell that the later has performance improvement, but it need a cf arg<rocksdb_colume_family_handle_t> and this can not be NULL, as I only use the default cf, I can't find any API to get the default cf handle, more important, other C APIs I use are all no-cf arg, change them to cf-version is troublesome.
How can I get the CF_handle of default cf by C API? thanks!
In C++, there is a straightforward API DB::DefaultColumnFamily for this, but there is no counterpart API in C.
https://github.com/facebook/rocksdb/blob/046ac91a7f887b1c1a970a7a950dd1e1689189e0/include/rocksdb/db.h#L1927
A workaround would be to use this rocksdb_open_column_families API to open the DB https://github.com/facebook/rocksdb/blob/046ac91a7f887b1c1a970a7a950dd1e1689189e0/db/c.cc#L915-L919
Passing the column_family_handles output argument to get a handle for the default column family to keep for your own use.
Maybe we should add a C API to easy get the default CF_handle, as C API with "_cf" ending is hard to use and most time the default CF is enough, but "rocksdb_batched_multi_get_cf" must have it.
Later I will make a submit to add the C API, the code is straightforward.