diff options
author | Vladimir Petrzhikovskii <hello@0xdeafbeef.dev> | 2024-04-30 14:59:38 +0200 |
---|---|---|
committer | Zaidoon Abd Al Hadi <43054535+zaidoon1@users.noreply.github.com> | 2024-05-08 11:21:59 -0400 |
commit | daaaf85fffb1c981aa93ca418b380ea2ea91aac3 (patch) | |
tree | a6b0c0c2b4adcbed26325de11c87452830bd70ac | |
parent | 6face7bb142d3d586383a99997e183db363f97fb (diff) |
docs: document that default cf doesn't inherit db open optionsmaster
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | src/db.rs | 14 | ||||
-rw-r--r-- | src/transactions/optimistic_transaction_db.rs | 3 |
3 files changed, 19 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index b68a0bb..9921d56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## [Unreleased] +* Document that `default` column family doesn't inherit open options of db ( + 0xdeafbeef) ## 0.22.0 (2024-02-13) @@ -408,6 +408,8 @@ impl<T: ThreadMode> DBWithThreadMode<T> { /// Opens a database with the given database with a Time to Live compaction filter and /// column family descriptors. + /// *NOTE*: `default` column family is opened with `Options::default()`. + /// If you want to open `default` cf with different options, set them explicitly in `cfs`. pub fn open_cf_descriptors_with_ttl<P, I>( opts: &Options, path: P, @@ -454,6 +456,8 @@ impl<T: ThreadMode> DBWithThreadMode<T> { } /// Opens a database for read only with the given database options and column family names. + /// *NOTE*: `default` column family is opened with `Options::default()`. + /// If you want to open `default` cf with different options, set them explicitly in `cfs`. pub fn open_cf_for_read_only<P, I, N>( opts: &Options, path: P, @@ -480,6 +484,8 @@ impl<T: ThreadMode> DBWithThreadMode<T> { } /// Opens a database for read only with the given database options and column family names. + /// *NOTE*: `default` column family is opened with `Options::default()`. + /// If you want to open `default` cf with different options, set them explicitly in `cfs`. pub fn open_cf_with_opts_for_read_only<P, I, N>( db_opts: &Options, path: P, @@ -507,6 +513,8 @@ impl<T: ThreadMode> DBWithThreadMode<T> { /// Opens a database for ready only with the given database options and /// column family descriptors. + /// *NOTE*: `default` column family is opened with `Options::default()`. + /// If you want to open `default` cf with different options, set them explicitly in `cfs`. pub fn open_cf_descriptors_read_only<P, I>( opts: &Options, path: P, @@ -528,6 +536,8 @@ impl<T: ThreadMode> DBWithThreadMode<T> { } /// Opens the database as a secondary with the given database options and column family names. + /// *NOTE*: `default` column family is opened with `Options::default()`. + /// If you want to open `default` cf with different options, set them explicitly in `cfs`. pub fn open_cf_as_secondary<P, I, N>( opts: &Options, primary_path: P, @@ -555,6 +565,8 @@ impl<T: ThreadMode> DBWithThreadMode<T> { /// Opens the database as a secondary with the given database options and /// column family descriptors. + /// *NOTE*: `default` column family is opened with `Options::default()`. + /// If you want to open `default` cf with different options, set them explicitly in `cfs`. pub fn open_cf_descriptors_as_secondary<P, I>( opts: &Options, path: P, @@ -576,6 +588,8 @@ impl<T: ThreadMode> DBWithThreadMode<T> { } /// Opens a database with the given database options and column family descriptors. + /// *NOTE*: `default` column family is opened with `Options::default()`. + /// If you want to open `default` cf with different options, set them explicitly in `cfs`. pub fn open_cf_descriptors<P, I>(opts: &Options, path: P, cfs: I) -> Result<Self, Error> where P: AsRef<Path>, diff --git a/src/transactions/optimistic_transaction_db.rs b/src/transactions/optimistic_transaction_db.rs index 5ce3bff..89a061c 100644 --- a/src/transactions/optimistic_transaction_db.rs +++ b/src/transactions/optimistic_transaction_db.rs @@ -100,6 +100,9 @@ impl<T: ThreadMode> OptimisticTransactionDB<T> { /// Opens a database with the given database options and column family names. /// /// Column families opened using this function will be created with default `Options`. + /// *NOTE*: `default` column family will be opened with the `Options::default()`. + /// If you want to open `default` column family with custom options, use `open_cf_descriptors` and + /// provide a `ColumnFamilyDescriptor` with the desired options. pub fn open_cf<P, I, N>(opts: &Options, path: P, cfs: I) -> Result<Self, Error> where P: AsRef<Path>, |