mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
fix loop for cancelling out databases (#19460)
* fix loop for cancelling out databases * remove loop and comments
This commit is contained in:
@@ -323,35 +323,31 @@ export async function promptForObjectName(bindingType: BindingType, connectionIn
|
||||
let connectionURI: string | undefined;
|
||||
let selectedDatabase: string | undefined;
|
||||
|
||||
while (true) {
|
||||
if (!connectionInfo) {
|
||||
// prompt is shown when user selects an existing connection string setting
|
||||
// or manually enters a connection string
|
||||
return promptToManuallyEnterObjectName(bindingType);
|
||||
}
|
||||
|
||||
// TODO create path to solve for selectView (first need to support views as well)
|
||||
// Prompt user to select a table based on connection profile and selected database}
|
||||
// get connectionURI and selectedDatabase to be used for listing tables query request
|
||||
connectionURI = await getConnectionURI(connectionInfo);
|
||||
if (!connectionURI) {
|
||||
// User cancelled or mssql connection error
|
||||
// we will then prompt user to choose a connection profile again
|
||||
continue;
|
||||
}
|
||||
selectedDatabase = await promptSelectDatabase(connectionURI);
|
||||
if (!selectedDatabase) {
|
||||
// User cancelled
|
||||
// we will then prompt user to choose a connection profile again
|
||||
continue;
|
||||
}
|
||||
|
||||
connectionInfo.database = selectedDatabase;
|
||||
|
||||
let selectedObjectName = await promptSelectTable(connectionURI, bindingType, selectedDatabase);
|
||||
|
||||
return selectedObjectName;
|
||||
if (!connectionInfo) {
|
||||
// prompt is shown when user selects an existing connection string setting
|
||||
// or manually enters a connection string
|
||||
return promptToManuallyEnterObjectName(bindingType);
|
||||
}
|
||||
|
||||
// TODO create path to solve for selectView (first need to support views as well)
|
||||
// Prompt user to select a table based on connection profile and selected database}
|
||||
// get connectionURI and selectedDatabase to be used for listing tables query request
|
||||
connectionURI = await getConnectionURI(connectionInfo);
|
||||
if (!connectionURI) {
|
||||
// mssql connection error
|
||||
return undefined;
|
||||
}
|
||||
selectedDatabase = await promptSelectDatabase(connectionURI);
|
||||
if (!selectedDatabase) {
|
||||
// User cancelled
|
||||
return undefined;
|
||||
}
|
||||
|
||||
connectionInfo.database = selectedDatabase;
|
||||
|
||||
let selectedObjectName = await promptSelectTable(connectionURI, bindingType, selectedDatabase);
|
||||
|
||||
return selectedObjectName;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user