Skip to content

Commit

Permalink
fix(cli): Fix config during database and table completions
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Aug 19, 2023
1 parent cad3b03 commit 73b3302
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/config/flags/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ func ExcludeTableData(cmd *cobra.Command, p *[]string) {

func listTables(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
conf := config.Exec{DisableHeaders: true}
if err := viper.Unmarshal(&conf); err != nil {
return nil, cobra.ShellCompDirectiveError
}

err := util.DefaultSetup(cmd, &conf.Global)
if err != nil {
return nil, cobra.ShellCompDirectiveError
Expand All @@ -158,6 +162,10 @@ func listTables(cmd *cobra.Command, args []string, toComplete string) ([]string,

func listDatabases(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
conf := config.Exec{DisableHeaders: true}
if err := viper.Unmarshal(&conf); err != nil {
return nil, cobra.ShellCompDirectiveError
}

err := util.DefaultSetup(cmd, &conf.Global)
if err != nil {
return nil, cobra.ShellCompDirectiveError
Expand Down

0 comments on commit 73b3302

Please sign in to comment.