File tree Expand file tree Collapse file tree 4 files changed +10
-6
lines changed
Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,10 @@ func (c *Root) IsValidSubCommand(command string) bool {
8989}
9090
9191func (c * Root ) addGlobalFlags () {
92+
93+ // BUG:(stuartpa) - This is a temporary flag until we have migrated
94+ // the kong impl to cobra. sqlcmd -? will show the kong help (all the back-compat
95+ // flags), sqlcmd --? will show the kong "did you mean one of" help.
9296 var unused bool
9397 c .AddFlag (cmdparser.FlagOptions {
9498 Bool : & unused ,
Original file line number Diff line number Diff line change @@ -38,13 +38,13 @@ func (c *Ads) DefineCommand(...cmdparser.CommandOptions) {
3838func (c * Ads ) run () {
3939 endpoint , user := config .CurrentContext ()
4040
41- hostname := endpoint .EndpointDetails .Address
42-
4341 // If the context has a local container, ensure it is running, otherwise bail out
4442 if endpoint .AssetDetails != nil && endpoint .AssetDetails .ContainerDetails != nil {
4543 c .ensureContainerIsRunning (endpoint )
4644 }
4745
46+ hostname := endpoint .EndpointDetails .Address
47+
4848 // If the hostname is localhost, ADS will not connect to the container
4949 // because it will try to connect to the host machine. To work around
5050 // BUG(stuartpa): I think this might be a bug in ADS?
@@ -75,7 +75,6 @@ func (c *Ads) ensureContainerIsRunning(endpoint sqlconfig.Endpoint) {
7575// launchAds launches the Azure Data Studio using the specified server and username.
7676func (c * Ads ) launchAds (host string , port int , username string ) {
7777 output := c .Output ()
78-
7978 args := []string {
8079 "-r" ,
8180 fmt .Sprintf (
Original file line number Diff line number Diff line change @@ -20,13 +20,15 @@ func AddContext(context Context) string {
2020 if ! EndpointExists (context .Endpoint ) {
2121 panic ("Endpoint doesn't exist" )
2222 }
23-
2423 username := ""
25- if context .User != nil && * context . User != "" {
24+ if context .User != nil {
2625 username = * context .User
2726 }
2827 context .Name = FindUniqueContextName (context .Name , username )
2928
29+ // The command line parser sets user by default to "", in the case there
30+ // is no user (therefore Windows Authentication), we omit the
31+ // user from the sqlconfig file yaml by setting it to nil here.
3032 if context .User != nil && * context .User == "" {
3133 context .User = nil
3234 }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments