| 334 | } |
| 335 | |
| 336 | async fn get_flight_info_tables( |
| 337 | &self, |
| 338 | _query: CommandGetTables, |
| 339 | request: Request<FlightDescriptor>, |
| 340 | ) -> Result<Response<FlightInfo>, Status> { |
| 341 | info!("get_flight_info_tables"); |
| 342 | let ctx = self.get_ctx(&request)?; |
| 343 | let data = self.tables(ctx).await; |
| 344 | let schema = data.schema(); |
| 345 | |
| 346 | let uuid = Uuid::new_v4().hyphenated().to_string(); |
| 347 | self.results.insert(uuid.clone(), vec![data]); |
| 348 | |
| 349 | let fetch = FetchResults { handle: uuid }; |
| 350 | let buf = fetch.as_any().encode_to_vec().into(); |
| 351 | let ticket = Ticket { ticket: buf }; |
| 352 | |
| 353 | let info = FlightInfo::new() |
| 354 | // Encode the Arrow schema |
| 355 | .try_with_schema(&schema) |
| 356 | .expect("encoding failed") |
| 357 | .with_endpoint(FlightEndpoint::new().with_ticket(ticket)) |
| 358 | .with_descriptor(FlightDescriptor { |
| 359 | r#type: DescriptorType::Cmd.into(), |
| 360 | cmd: Default::default(), |
| 361 | path: vec![], |
| 362 | }); |
| 363 | let resp = Response::new(info); |
| 364 | Ok(resp) |
| 365 | } |
| 366 | |
| 367 | async fn do_put_prepared_statement_update( |
| 368 | &self, |