removed key in new()

main
Niko PLP 1 month ago
parent c2d31daa1c
commit b3ae51da82
  1. 7
      lib/oxigraph/src/storage/backend/oxi_rocksdb.rs
  2. 4
      lib/oxigraph/src/storage/mod.rs
  3. 8
      lib/oxigraph/src/store.rs

@ -155,11 +155,8 @@ impl Drop for RoDbHandler {
} }
impl Db { impl Db {
pub fn new( pub fn new(column_families: Vec<ColumnFamilyDefinition>) -> Result<Self, StorageError> {
column_families: Vec<ColumnFamilyDefinition>, Self::open_read_write(None, column_families, None)
key: Option<[u8; 32]>,
) -> Result<Self, StorageError> {
Self::open_read_write(None, column_families, key)
} }
pub fn open_read_write( pub fn open_read_write(

@ -72,8 +72,8 @@ pub struct Storage {
} }
impl Storage { impl Storage {
pub fn new(key: Option<[u8; 32]>) -> Result<Self, StorageError> { pub fn new() -> Result<Self, StorageError> {
Self::setup(Db::new(Self::column_families(), key)?) Self::setup(Db::new(Self::column_families())?)
} }
#[cfg(all(not(target_family = "wasm")))] #[cfg(all(not(target_family = "wasm")))]

@ -91,13 +91,7 @@ impl Store {
/// Creates a temporary [`Store`] that will be deleted after drop. /// Creates a temporary [`Store`] that will be deleted after drop.
pub fn new() -> Result<Self, StorageError> { pub fn new() -> Result<Self, StorageError> {
Ok(Self { Ok(Self {
storage: Storage::new(None)?, storage: Storage::new()?,
})
}
pub fn new_with_key(key: [u8; 32]) -> Result<Self, StorageError> {
Ok(Self {
storage: Storage::new(Some(key))?,
}) })
} }

Loading…
Cancel
Save