From 1af596a4b32e1b80c6dc5063ac4bda70c16fb2d2 Mon Sep 17 00:00:00 2001 From: Gary Tierney Date: Sun, 27 Aug 2017 19:52:45 +0100 Subject: [PATCH] Expose create_missing_column_families option --- src/db_options.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/db_options.rs b/src/db_options.rs index eea8e97..d971e0c 100644 --- a/src/db_options.rs +++ b/src/db_options.rs @@ -146,6 +146,25 @@ impl Options { } } + /// If true, any column families that didn't exist when opening the database + /// will be created. + /// + /// Default: `false` + /// + /// # Example + /// + /// ``` + /// use rocksdb::Options; + /// + /// let mut opts = Options::default(); + /// opts.create_missing_column_families(true); + /// ``` + pub fn create_missing_column_families(&mut self, create_missing_cfs: bool) { + unsafe { + ffi::rocksdb_options_set_create_missing_column_families(self.inner, create_missing_cfs as c_uchar); + } + } + /// Sets the compression algorithm that will be used for the bottommost level that /// contain files. If level-compaction is used, this option will only affect /// levels after base level.