@@ -390,6 +390,9 @@ fn main() {
390390 Some ( DatabasesCommands :: List { output } ) => {
391391 databases:: list ( & workspace_id, & output)
392392 }
393+ Some ( DatabasesCommands :: Show { name_or_id, output } ) => {
394+ databases:: get ( & workspace_id, & name_or_id, & output)
395+ }
393396 Some ( DatabasesCommands :: Create {
394397 description,
395398 schema,
@@ -427,43 +430,63 @@ fn main() {
427430 upload_id. as_deref ( ) ,
428431 )
429432 }
430- Some ( DatabasesCommands :: Tables { command } ) => match command {
431- DatabaseTablesCommands :: List {
432- database,
433+ Some ( DatabasesCommands :: Tables { database , command } ) => match command {
434+ Some ( DatabaseTablesCommands :: List {
435+ database : db_flag ,
433436 schema,
434437 output,
435- } => databases:: tables_list (
438+ } ) => databases:: tables_list (
436439 & workspace_id,
437- database. as_deref ( ) ,
440+ db_flag . as_deref ( ) . or ( database. as_deref ( ) ) ,
438441 schema. as_deref ( ) ,
439442 & output,
440443 ) ,
441- DatabaseTablesCommands :: Load {
442- database,
444+ Some ( DatabaseTablesCommands :: Load {
445+ database : db_flag ,
443446 table,
444447 schema,
445448 file,
446449 url,
447450 upload_id,
448- } => databases:: tables_load (
451+ } ) => databases:: tables_load (
449452 & workspace_id,
450- database. as_deref ( ) ,
453+ db_flag . as_deref ( ) . or ( database. as_deref ( ) ) ,
451454 & table,
452455 Some ( schema. as_str ( ) ) ,
453456 file. as_deref ( ) ,
454457 url. as_deref ( ) ,
455458 upload_id. as_deref ( ) ,
456459 ) ,
457- DatabaseTablesCommands :: Delete {
458- database,
460+ Some ( DatabaseTablesCommands :: Delete {
461+ database : db_flag ,
459462 table,
460463 schema,
461- } => databases:: tables_delete (
464+ } ) => databases:: tables_delete (
462465 & workspace_id,
463- database. as_deref ( ) ,
466+ db_flag . as_deref ( ) . or ( database. as_deref ( ) ) ,
464467 & table,
465468 Some ( schema. as_str ( ) ) ,
466469 ) ,
470+ None => {
471+ if let Some ( ref db) = database {
472+ databases:: tables_list (
473+ & workspace_id,
474+ Some ( db. as_str ( ) ) ,
475+ None ,
476+ "table" ,
477+ )
478+ } else {
479+ use clap:: CommandFactory ;
480+ let mut cmd = Cli :: command ( ) ;
481+ cmd. build ( ) ;
482+ cmd. find_subcommand_mut ( "databases" )
483+ . unwrap ( )
484+ . find_subcommand_mut ( "tables" )
485+ . unwrap ( )
486+ . print_help ( )
487+ . unwrap ( ) ;
488+ }
489+ }
467490 } ,
468491 None => {
469492 use clap:: CommandFactory ;
@@ -507,7 +530,7 @@ fn main() {
507530 skill:: install ( )
508531 }
509532 }
510- SkillCommands :: Status => skill:: status ( ) ,
533+ SkillCommands :: Status | SkillCommands :: List => skill:: status ( ) ,
511534 } ,
512535 Commands :: Results {
513536 result_id,
0 commit comments