mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
add progress noticiations for database that would contain lots of tables (#19572)
This commit is contained in:
@@ -666,11 +666,20 @@ export async function promptSelectTable(connectionURI: string, bindingType: Bind
|
|||||||
// Create query to get list of tables from database selected
|
// Create query to get list of tables from database selected
|
||||||
let tableQuery = tablesQuery(selectedDatabase);
|
let tableQuery = tablesQuery(selectedDatabase);
|
||||||
const params = { ownerUri: connectionURI, queryString: tableQuery };
|
const params = { ownerUri: connectionURI, queryString: tableQuery };
|
||||||
// send SimpleExecuteRequest query to STS to get list of schema and tables based on the connection profile of the user
|
let queryResult: azureFunctionsContracts.SimpleExecuteResult | undefined;
|
||||||
let queryResult: azureFunctionsContracts.SimpleExecuteResult = await vscodeMssqlApi.sendRequest(azureFunctionsContracts.SimpleExecuteRequest.type, params);
|
// send SimpleExecuteRequest query to STS to get list of schema and tables based on the connection profile and database of the user
|
||||||
|
await vscode.window.withProgress(
|
||||||
|
{
|
||||||
|
location: vscode.ProgressLocation.Notification,
|
||||||
|
title: constants.tableListProgressTitle,
|
||||||
|
cancellable: false
|
||||||
|
}, async (_progress, _token) => {
|
||||||
|
queryResult = await vscodeMssqlApi.sendRequest(azureFunctionsContracts.SimpleExecuteRequest.type, params);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// Get schema and table names from query result rows
|
// Get schema and table names from query result rows
|
||||||
const tableNames = queryResult.rows.map(r => r[0].displayValue);
|
const tableNames = queryResult!.rows.map(r => r[0].displayValue);
|
||||||
// add manual entry option to table names list for user to choose from as well (with pencil icon)
|
// add manual entry option to table names list for user to choose from as well (with pencil icon)
|
||||||
let manuallyEnterObjectName = '$(pencil) ' + userObjectName;
|
let manuallyEnterObjectName = '$(pencil) ' + userObjectName;
|
||||||
tableNames.unshift(manuallyEnterObjectName);
|
tableNames.unshift(manuallyEnterObjectName);
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ export const connectionProgressTitle = localize('connectionProgressTitle', "Test
|
|||||||
export const enterObjectName = localize('enterObjectName', 'Enter SQL table or view to query');
|
export const enterObjectName = localize('enterObjectName', 'Enter SQL table or view to query');
|
||||||
export const enterObjectNameToUpsert = localize('enterObjectNameToUpsert', 'Enter SQL table to upsert into');
|
export const enterObjectNameToUpsert = localize('enterObjectNameToUpsert', 'Enter SQL table to upsert into');
|
||||||
export const selectTable = localize('selectTable', 'Select table to use');
|
export const selectTable = localize('selectTable', 'Select table to use');
|
||||||
|
export const tableListProgressTitle = localize('tableListProgressTitle', "Fetching tables for selected database...");
|
||||||
export const selectConnectionError = (err?: any): string => err ? localize('selectConnectionError', "Failed to set connection string app setting: {0}", utils.getErrorMessage(err)) : localize('unableToSetConnectionString', "Failed to set connection string app setting");
|
export const selectConnectionError = (err?: any): string => err ? localize('selectConnectionError', "Failed to set connection string app setting: {0}", utils.getErrorMessage(err)) : localize('unableToSetConnectionString', "Failed to set connection string app setting");
|
||||||
export function selectBindingType(funcName?: string): string { return funcName ? localize('selectBindingTypeToSpecifiedFunction', "Select type of binding for the function '{0}'", funcName) : localize('selectBindingType', "Select type of binding"); }
|
export function selectBindingType(funcName?: string): string { return funcName ? localize('selectBindingTypeToSpecifiedFunction', "Select type of binding for the function '{0}'", funcName) : localize('selectBindingType', "Select type of binding"); }
|
||||||
export function settingAlreadyExists(settingName: string): string { return localize('SettingAlreadyExists', 'Local app setting \'{0}\' already exists. Overwrite?', settingName); }
|
export function settingAlreadyExists(settingName: string): string { return localize('SettingAlreadyExists', 'Local app setting \'{0}\' already exists. Overwrite?', settingName); }
|
||||||
|
|||||||
Reference in New Issue
Block a user