@@ -8,18 +8,15 @@ import (
88 "runtime"
99 "strings"
1010
11- "github.com/microsoft/go-sqlcmd/cmd/modern/root/open"
1211 "github.com/microsoft/go-sqlcmd/cmd/modern/sqlconfig"
1312 "github.com/microsoft/go-sqlcmd/internal/cmdparser"
14- "github.com/microsoft/go-sqlcmd/internal/cmdparser/dependency"
1513 "github.com/microsoft/go-sqlcmd/internal/config"
1614 "github.com/microsoft/go-sqlcmd/internal/container"
1715 "github.com/microsoft/go-sqlcmd/internal/localizer"
1816 "github.com/microsoft/go-sqlcmd/internal/output"
1917 "github.com/microsoft/go-sqlcmd/internal/pal"
2018 "github.com/microsoft/go-sqlcmd/internal/secret"
2119 "github.com/microsoft/go-sqlcmd/internal/sql"
22- "github.com/microsoft/go-sqlcmd/internal/tools"
2320 "github.com/microsoft/go-sqlcmd/pkg/mssqlcontainer/ingest"
2421 "github.com/microsoft/go-sqlcmd/pkg/mssqlcontainer/ingest/mechanism"
2522 "github.com/spf13/viper"
@@ -246,20 +243,6 @@ func (c *MssqlBase) AddFlags(
246243 Name : "use-mechanism" ,
247244 Usage : localizer .Sprintf ("Mechanism to use to bring database online (%s)" , strings .Join (mechanism .Mechanisms (), "," )),
248245 })
249-
250- addFlag (cmdparser.FlagOptions {
251- String : & c .openTool ,
252- DefaultString : "" ,
253- Name : "open" ,
254- Usage : localizer .Sprintf ("Open tool e.g. ads" ),
255- })
256-
257- addFlag (cmdparser.FlagOptions {
258- String : & c .openFile ,
259- DefaultString : "" ,
260- Name : "open-file" ,
261- Usage : localizer .Sprintf ("Open file in tool e.g. https://aks.ms/adventureworks-demo.sql" ),
262- })
263246}
264247
265248// Run checks that the end-user license agreement has been accepted,
@@ -401,11 +384,6 @@ func (c *MssqlBase) createContainer(imageName string, contextName string) {
401384 }
402385 useDatabase .CopyToContainer (containerId )
403386
404- if useDatabase .IsExtractionNeeded () {
405- output .Infof ("Extracting files from %q archive" , useDatabase .UrlFilename ())
406- useDatabase .Extract ()
407- }
408-
409387 output .Infof ("Bringing database %q online" , useDatabase .DatabaseName ())
410388 useDatabase .BringOnline (c .sql .Query , contextOptions .Username , contextOptions .Password )
411389 }
@@ -440,41 +418,6 @@ func (c *MssqlBase) createContainer(imageName string, contextName string) {
440418 c .port ),
441419 )
442420 }
443-
444- if c .openTool == "ads" {
445- ads := open.Ads {}
446- ads .SetCrossCuttingConcerns (dependency.Options {
447- EndOfLine : pal .LineBreak (),
448- Output : c .Output (),
449- })
450-
451- user := & sqlconfig.User {
452- AuthenticationType : "basic" ,
453- BasicAuth : & sqlconfig.BasicAuthDetails {
454- Username : contextOptions .Username ,
455- PasswordEncryption : c .passwordEncryption ,
456- Password : secret .Encode (contextOptions .Password , c .passwordEncryption )},
457- Name : contextOptions .Username }
458-
459- ads .PersistCredentialForAds (endpoint .EndpointDetails .Address , endpoint , user )
460-
461- output := c .Output ()
462- args := []string {"-r" , fmt .Sprintf ("--server=%s" , fmt .Sprintf (
463- "%s,%d" ,
464- "127.0.0.1" ,
465- c .port ))}
466-
467- args = append (args , fmt .Sprintf ("--user=%s" ,
468- strings .Replace (contextOptions .Username , `"` , `\"` , - 1 )))
469-
470- tool := tools .NewTool ("ads" )
471- if ! tool .IsInstalled () {
472- output .Fatalf (tool .HowToInstall ())
473- }
474-
475- _ , err := tool .Run (args )
476- c .CheckErr (err )
477- }
478421}
479422
480423func (c * MssqlBase ) verifyUseSourceFileExists (
0 commit comments