From 09d5873b1a577958e6c1351d3f5246bce5c1cd4d Mon Sep 17 00:00:00 2001 From: Lewis Steele Date: Wed, 27 Nov 2024 19:27:37 +0000 Subject: [PATCH] Remove selected db --- cmd/connect.go | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/cmd/connect.go b/cmd/connect.go index a106bb2..b9da2b7 100644 --- a/cmd/connect.go +++ b/cmd/connect.go @@ -7,7 +7,6 @@ import ( "image/color" "github.com/c-bata/go-prompt" - "github.com/charmbracelet/huh" "github.com/jedib0t/go-pretty/v6/table" "github.com/lewissteele/dbat/internal/db" "github.com/lewissteele/dbat/internal/input" @@ -94,33 +93,3 @@ func executor(query string) { func completer(d prompt.Document) []prompt.Suggest { return []prompt.Suggest{} } - -func selectedDB(args []string) string { - if len(args) > 0 { - return args[0] - } - - var name string - - options := []huh.Option[string]{} - - for _, n := range db.UserDBNames() { - options = append(options, huh.NewOption[string](n, n)) - } - - form := huh.NewForm( - huh.NewGroup( - huh.NewSelect[string]().Title("database").Value(&name).Options( - options... - ), - ), - ) - - err := form.Run() - - if err != nil { - panic(err) - } - - return name -}