Check if a view exists. # Arguments `name` - The name of the view to check
(&self, name: &str)
| 358 | /// |
| 359 | /// * `name` - The name of the view to check |
| 360 | pub fn view_exists(&self, name: &str) -> Result<bool, RepositoryError> { |
| 361 | let txn = self |
| 362 | .pristine |
| 363 | .read_txn() |
| 364 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 365 | |
| 366 | Ok(txn |
| 367 | .get_view(name) |
| 368 | .map_err(|e| RepositoryError::Database(e.to_string()))? |
| 369 | .is_some()) |
| 370 | } |
| 371 | |
| 372 | /// Delete a view from the repository. |
| 373 | /// |