File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,12 +115,12 @@ async fn extension_versions(
115115}
116116
117117#[ derive( sqlx:: FromRow , PartialEq , Eq , Hash ) ]
118- struct UpdatePath {
119- source : String ,
120- target : String ,
118+ pub ( crate ) struct UpdatePath {
119+ pub ( crate ) source : String ,
120+ pub ( crate ) target : String ,
121121}
122122
123- async fn update_paths (
123+ pub ( crate ) async fn update_paths (
124124 conn : & mut PgConnection ,
125125 extension_name : & str ,
126126) -> anyhow:: Result < HashSet < UpdatePath > > {
Original file line number Diff line number Diff line change @@ -3,14 +3,27 @@ use std::collections::HashMap;
33use futures:: TryStreamExt ;
44use sqlx:: PgConnection ;
55
6+ use crate :: commands:: install:: update_paths;
7+
68pub ( crate ) async fn list ( conn : & mut PgConnection ) -> anyhow:: Result < ( ) > {
79 let available_extensions = available_extensions ( conn) . await ?;
810
9- for ( extension, versions) in available_extensions {
10- println ! ( "{extension}" ) ;
11+ for ( extension_name, versions) in available_extensions {
12+ println ! ( "{extension_name}" ) ;
13+ println ! ( " available versions:" ) ;
1114 for version in versions {
12- println ! ( " {version}" ) ;
15+ println ! ( " {version}" ) ;
16+ }
17+ println ! ( " available update paths:" ) ;
18+ let update_paths = update_paths ( conn, & extension_name) . await ?;
19+ if update_paths. is_empty ( ) {
20+ println ! ( " None" ) ;
21+ } else {
22+ for update_path in update_paths {
23+ println ! ( " from {} to {}" , update_path. source, update_path. target) ;
24+ }
1325 }
26+ println ! ( ) ;
1427 }
1528
1629 Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments