fix loop for cancelling out databases (#19460)

* fix loop for cancelling out databases

* remove loop and comments
This commit is contained in:
Vasu Bhog
2022-05-20 13:47:53 -07:00
committed by GitHub
parent 529296110b
commit 1959736078

View File

@@ -323,7 +323,6 @@ export async function promptForObjectName(bindingType: BindingType, connectionIn
let connectionURI: string | undefined; let connectionURI: string | undefined;
let selectedDatabase: string | undefined; let selectedDatabase: string | undefined;
while (true) {
if (!connectionInfo) { if (!connectionInfo) {
// prompt is shown when user selects an existing connection string setting // prompt is shown when user selects an existing connection string setting
// or manually enters a connection string // or manually enters a connection string
@@ -335,15 +334,13 @@ export async function promptForObjectName(bindingType: BindingType, connectionIn
// get connectionURI and selectedDatabase to be used for listing tables query request // get connectionURI and selectedDatabase to be used for listing tables query request
connectionURI = await getConnectionURI(connectionInfo); connectionURI = await getConnectionURI(connectionInfo);
if (!connectionURI) { if (!connectionURI) {
// User cancelled or mssql connection error // mssql connection error
// we will then prompt user to choose a connection profile again return undefined;
continue;
} }
selectedDatabase = await promptSelectDatabase(connectionURI); selectedDatabase = await promptSelectDatabase(connectionURI);
if (!selectedDatabase) { if (!selectedDatabase) {
// User cancelled // User cancelled
// we will then prompt user to choose a connection profile again return undefined;
continue;
} }
connectionInfo.database = selectedDatabase; connectionInfo.database = selectedDatabase;
@@ -351,7 +348,6 @@ export async function promptForObjectName(bindingType: BindingType, connectionIn
let selectedObjectName = await promptSelectTable(connectionURI, bindingType, selectedDatabase); let selectedObjectName = await promptSelectTable(connectionURI, bindingType, selectedDatabase);
return selectedObjectName; return selectedObjectName;
}
} }
/** /**