@@ -5,12 +5,12 @@ use super::{
55 prelude:: Message , probe:: Probe , reconnect:: Reconnect , reload:: Reload ,
66 reset_query_cache:: ResetQueryCache , set:: Set , setup_schema:: SetupSchema ,
77 show_client_memory:: ShowClientMemory , show_clients:: ShowClients , show_config:: ShowConfig ,
8- show_instance_id :: ShowInstanceId , show_lists :: ShowLists , show_mirrors :: ShowMirrors ,
9- show_peers :: ShowPeers , show_pools :: ShowPools , show_prepared_statements :: ShowPreparedStatements ,
10- show_query_cache :: ShowQueryCache , show_replication :: ShowReplication ,
11- show_server_memory :: ShowServerMemory , show_servers :: ShowServers , show_stats :: ShowStats ,
12- show_transactions :: ShowTransactions , show_version :: ShowVersion , shutdown :: Shutdown , Command ,
13- Error ,
8+ show_fdw :: ShowFdw , show_instance_id :: ShowInstanceId , show_lists :: ShowLists ,
9+ show_mirrors :: ShowMirrors , show_peers :: ShowPeers , show_pools :: ShowPools ,
10+ show_prepared_statements :: ShowPreparedStatements , show_query_cache :: ShowQueryCache ,
11+ show_replication :: ShowReplication , show_server_memory :: ShowServerMemory ,
12+ show_servers :: ShowServers , show_stats :: ShowStats , show_transactions :: ShowTransactions ,
13+ show_version :: ShowVersion , shutdown :: Shutdown , Command , Error ,
1414} ;
1515
1616use tracing:: debug;
@@ -44,6 +44,7 @@ pub enum ParseResult {
4444 Probe ( Probe ) ,
4545 MaintenanceMode ( MaintenanceMode ) ,
4646 Healthcheck ( Healthcheck ) ,
47+ ShowFdw ( ShowFdw ) ,
4748}
4849
4950impl ParseResult {
@@ -79,6 +80,7 @@ impl ParseResult {
7980 Probe ( probe) => probe. execute ( ) . await ,
8081 MaintenanceMode ( maintenance_mode) => maintenance_mode. execute ( ) . await ,
8182 Healthcheck ( healthcheck) => healthcheck. execute ( ) . await ,
83+ ShowFdw ( show_fdw) => show_fdw. execute ( ) . await ,
8284 }
8385 }
8486
@@ -114,6 +116,7 @@ impl ParseResult {
114116 Probe ( probe) => probe. name ( ) ,
115117 MaintenanceMode ( maintenance_mode) => maintenance_mode. name ( ) ,
116118 Healthcheck ( healthcheck) => healthcheck. name ( ) ,
119+ ShowFdw ( show_fdw) => show_fdw. name ( ) ,
117120 }
118121 }
119122}
@@ -163,6 +166,7 @@ impl Parser {
163166 "lists" => ParseResult :: ShowLists ( ShowLists :: parse ( & sql) ?) ,
164167 "prepared" => ParseResult :: ShowPrepared ( ShowPreparedStatements :: parse ( & sql) ?) ,
165168 "replication" => ParseResult :: ShowReplication ( ShowReplication :: parse ( & sql) ?) ,
169+ "fdw" => ParseResult :: ShowFdw ( ShowFdw :: parse ( & sql) ?) ,
166170 command => {
167171 debug ! ( "unknown admin show command: '{}'" , command) ;
168172 return Err ( Error :: Syntax ) ;
@@ -229,4 +233,10 @@ mod tests {
229233 let result = Parser :: parse ( "SHOW CLIENT MEMORY;" ) ;
230234 assert ! ( matches!( result, Ok ( ParseResult :: ShowClientMemory ( _) ) ) ) ;
231235 }
236+
237+ #[ test]
238+ fn parses_show_fdw_command ( ) {
239+ let result = Parser :: parse ( "SHOW FDW;" ) ;
240+ assert ! ( matches!( result, Ok ( ParseResult :: ShowFdw ( _) ) ) ) ;
241+ }
232242}
0 commit comments