|
|
@ -57,7 +57,7 @@ type DefaultThreadMode = crate::MultiThreaded; |
|
|
|
/// {
|
|
|
|
/// {
|
|
|
|
/// let db: TransactionDB = TransactionDB::open_default(path).unwrap();
|
|
|
|
/// let db: TransactionDB = TransactionDB::open_default(path).unwrap();
|
|
|
|
/// db.put(b"my key", b"my value").unwrap();
|
|
|
|
/// db.put(b"my key", b"my value").unwrap();
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// // create transaction
|
|
|
|
/// // create transaction
|
|
|
|
/// let txn = db.transaction();
|
|
|
|
/// let txn = db.transaction();
|
|
|
|
/// txn.put(b"key2", b"value2");
|
|
|
|
/// txn.put(b"key2", b"value2");
|
|
|
@ -359,11 +359,9 @@ impl<T: ThreadMode> TransactionDB<T> { |
|
|
|
name: &str, |
|
|
|
name: &str, |
|
|
|
opts: &Options, |
|
|
|
opts: &Options, |
|
|
|
) -> Result<*mut ffi::rocksdb_column_family_handle_t, Error> { |
|
|
|
) -> Result<*mut ffi::rocksdb_column_family_handle_t, Error> { |
|
|
|
let Ok(cf_name) = CString::new(name.as_bytes()) else { |
|
|
|
let cf_name = CString::new(name.as_bytes()).map_err(|_| { |
|
|
|
return Err(Error::new( |
|
|
|
Error::new("Failed to convert path to CString when creating cf".to_owned()) |
|
|
|
"Failed to convert path to CString when creating cf".to_owned(), |
|
|
|
})?; |
|
|
|
)); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ok(unsafe { |
|
|
|
Ok(unsafe { |
|
|
|
ffi_try!(ffi::rocksdb_transactiondb_create_column_family( |
|
|
|
ffi_try!(ffi::rocksdb_transactiondb_create_column_family( |
|
|
|