Create a new database.
(
&self,
name: &str,
options: Option<HashMap<String, String>>,
)
| 227 | |
| 228 | /// Create a new database. |
| 229 | pub async fn create_database( |
| 230 | &self, |
| 231 | name: &str, |
| 232 | options: Option<HashMap<String, String>>, |
| 233 | ) -> Result<()> { |
| 234 | validate_non_empty(name, "database name")?; |
| 235 | let path = self.resource_paths.databases(); |
| 236 | let request = CreateDatabaseRequest::new(name.to_string(), options.unwrap_or_default()); |
| 237 | let _resp: serde_json::Value = self.client.post(&path, &request).await?; |
| 238 | Ok(()) |
| 239 | } |
| 240 | |
| 241 | /// Get database information. |
| 242 | pub async fn get_database(&self, name: &str) -> Result<GetDatabaseResponse> { |
no test coverage detected