Create a new table.
(&self, identifier: &Identifier, schema: Schema)
| 334 | |
| 335 | /// Create a new table. |
| 336 | pub async fn create_table(&self, identifier: &Identifier, schema: Schema) -> Result<()> { |
| 337 | let database = identifier.database(); |
| 338 | let table = identifier.object(); |
| 339 | validate_non_empty_multi(&[(database, "database name"), (table, "table name")])?; |
| 340 | let path = self.resource_paths.tables(Some(database)); |
| 341 | let request = CreateTableRequest::new(identifier.clone(), schema); |
| 342 | let _resp: serde_json::Value = self.client.post(&path, &request).await?; |
| 343 | Ok(()) |
| 344 | } |
| 345 | |
| 346 | /// Get table information. |
| 347 | pub async fn get_table(&self, identifier: &Identifier) -> Result<GetTableResponse> { |