summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md2
-rw-r--r--src/db.rs14
-rw-r--r--src/transactions/optimistic_transaction_db.rs3
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)
diff --git a/src/db.rs b/src/db.rs
index 554fd79..da4c378 100644
--- a/src/db.rs
+++ b/src/db.rs
@@ -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>,