(&self, env: &Environment, db: Database)
| 358 | /// deletes a collection instance from the disk (lmdb -> collections database) |
| 359 | #[allow(dead_code)] |
| 360 | pub fn delete(&self, env: &Environment, db: Database) -> Result<(), WaCustomError> { |
| 361 | let key = self.get_key(); |
| 362 | |
| 363 | let mut txn = env |
| 364 | .begin_rw_txn() |
| 365 | .map_err(|e| WaCustomError::DatabaseError(e.to_string()))?; |
| 366 | |
| 367 | txn.del(db, &key, None) |
| 368 | .map_err(|e| WaCustomError::DatabaseError(e.to_string()))?; |
| 369 | txn.commit() |
| 370 | .map_err(|e| WaCustomError::DatabaseError(e.to_string()))?; |
| 371 | |
| 372 | Ok(()) |
| 373 | } |
| 374 | |
| 375 | pub fn get_hnsw_index(&self) -> Option<Arc<HNSWIndex>> { |
| 376 | self.hnsw_index.read().clone() |
no test coverage detected