1616// under the License.
1717//! [`CliApp`]: Command Line User Interface
1818
19- use crate :: args:: Command ;
2019use crate :: config:: AppConfig ;
2120use crate :: db:: register_db;
2221use crate :: { args:: DftArgs , execution:: AppExecution } ;
@@ -40,8 +39,7 @@ use std::io::Write;
4039use std:: path:: { Path , PathBuf } ;
4140#[ cfg( feature = "flightsql" ) ]
4241use {
43- crate :: args:: FlightSqlCommand ,
44- arrow_flight:: FlightInfo ,
42+ crate :: args:: { Command , FlightSqlCommand } ,
4543 datafusion_app:: {
4644 config:: { AuthConfig , FlightSQLConfig } ,
4745 flightsql:: FlightSQLContext ,
@@ -87,14 +85,24 @@ impl CliApp {
8785
8886 #[ cfg( feature = "flightsql" ) ]
8987 async fn handle_flightsql_command ( & self , command : FlightSqlCommand ) -> color_eyre:: Result < ( ) > {
88+ use futures:: stream;
89+
9090 match command {
9191 FlightSqlCommand :: StatementQuery { sql } => self . exec_from_flightsql ( sql, 0 ) . await ,
92- FlightSqlCommand :: Catalogs => {
92+ FlightSqlCommand :: GetCatalogs => {
9393 let flight_info = self
9494 . app_execution
9595 . flightsql_ctx ( )
9696 . get_catalogs_flight_info ( )
9797 . await ?;
98+ let streams = self
99+ . app_execution
100+ . flightsql_ctx ( )
101+ . do_get ( flight_info)
102+ . await ?;
103+ let flight_batch_stream = stream:: select_all ( streams) ;
104+ self . print_any_stream ( flight_batch_stream) . await ;
105+
98106 Ok ( ( ) )
99107 }
100108 }
0 commit comments