Check if a view exists. # Arguments `name` - The name of the view to check
(&self, name: &str)
| 488 | /// |
| 489 | /// * `name` - The name of the view to check |
| 490 | pub fn view_exists(&self, name: &str) -> Result<bool, RepositoryError> { |
| 491 | let txn = self |
| 492 | .pristine |
| 493 | .read_txn() |
| 494 | .map_err(|e| RepositoryError::Database(e.to_string()))?; |
| 495 | |
| 496 | Ok(txn |
| 497 | .get_view(name) |
| 498 | .map_err(|e| RepositoryError::Database(e.to_string()))? |
| 499 | .is_some()) |
| 500 | } |
| 501 | |
| 502 | /// Preview which changes would lose their last view reference on deletion. |
| 503 | /// |