C API: create missing cf's, cleanup

main
Reed Allman 10 years ago
parent 105c1e099b
commit 1fc71a4b16
  1. 5
      db/c.cc
  2. 1
      db/c_test.c
  3. 4
      include/rocksdb/c.h

@ -1015,6 +1015,11 @@ void rocksdb_options_set_create_if_missing(
opt->rep.create_if_missing = v;
}
void rocksdb_options_set_create_missing_column_families(
rocksdb_options_t* opt, unsigned char v) {
opt->rep.create_missing_column_families = v;
}
void rocksdb_options_set_error_if_exists(
rocksdb_options_t* opt, unsigned char v) {
opt->rep.error_if_exists = v;

@ -576,7 +576,6 @@ int main(int argc, char** argv) {
size_t cflen;
char** column_fams = rocksdb_list_column_families(db_options, dbname, &cflen, &err);
CheckNoError(err);
// TODO column_families vals seg fault
CheckEqual("default", column_fams[0], 7);
CheckEqual("cf1", column_fams[1], 3);
CheckCondition(cflen == 2);

@ -133,7 +133,7 @@ extern void rocksdb_drop_column_family(
rocksdb_column_family_handle_t* handle,
char** errptr);
extern void rocksdb_column_family_handle_destroy(rocksdb_column_family_handle_t* handle);
extern void rocksdb_column_family_handle_destroy(rocksdb_column_family_handle_t*);
extern void rocksdb_close(rocksdb_t* db);
@ -373,6 +373,8 @@ extern void rocksdb_options_set_filter_policy(
rocksdb_filterpolicy_t*);
extern void rocksdb_options_set_create_if_missing(
rocksdb_options_t*, unsigned char);
extern void rocksdb_options_set_create_missing_column_families(
rocksdb_options_t*, unsigned char);
extern void rocksdb_options_set_error_if_exists(
rocksdb_options_t*, unsigned char);
extern void rocksdb_options_set_paranoid_checks(

Loading…
Cancel
Save