mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-06 01:25:38 -05:00
@@ -63,7 +63,7 @@ export class CommandLineService implements ICommandLineProcessing {
|
||||
// prompt the user for a new connection on startup if no profiles are registered
|
||||
this._connectionManagementService.showConnectionDialog();
|
||||
} else if (this._connectionProfile) {
|
||||
this._connectionManagementService.connectIfNotConnected(this._connectionProfile, 'connection')
|
||||
this._connectionManagementService.connectIfNotConnected(this._connectionProfile, 'connection', true)
|
||||
.then(result => TaskUtilities.newQuery(this._connectionProfile,
|
||||
this._connectionManagementService,
|
||||
this._queryEditorService,
|
||||
|
||||
@@ -121,7 +121,7 @@ export interface IConnectionManagementService {
|
||||
* otherwise tries to make a connection and returns the owner uri when connection is complete
|
||||
* The purpose is connection by default
|
||||
*/
|
||||
connectIfNotConnected(connection: IConnectionProfile, purpose?: 'dashboard' | 'insights' | 'connection'): Promise<string>;
|
||||
connectIfNotConnected(connection: IConnectionProfile, purpose?: 'dashboard' | 'insights' | 'connection', saveConnection?: boolean): Promise<string>;
|
||||
|
||||
/**
|
||||
* Adds the successful connection to MRU and send the connection error back to the connection handler for failed connections
|
||||
|
||||
@@ -380,14 +380,14 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
* otherwise tries to make a connection and returns the owner uri when connection is complete
|
||||
* The purpose is connection by default
|
||||
*/
|
||||
public connectIfNotConnected(connection: IConnectionProfile, purpose?: 'dashboard' | 'insights' | 'connection'): Promise<string> {
|
||||
public connectIfNotConnected(connection: IConnectionProfile, purpose?: 'dashboard' | 'insights' | 'connection', saveConnection: boolean = false): Promise<string> {
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
let ownerUri: string = Utils.generateUri(connection, purpose);
|
||||
if (this._connectionStatusManager.isConnected(ownerUri)) {
|
||||
resolve(this._connectionStatusManager.getOriginalOwnerUri(ownerUri));
|
||||
} else {
|
||||
const options: IConnectionCompletionOptions = {
|
||||
saveTheConnection: false,
|
||||
saveTheConnection: saveConnection,
|
||||
showConnectionDialogOnError: true,
|
||||
showDashboard: purpose === 'dashboard',
|
||||
params: undefined,
|
||||
|
||||
Reference in New Issue
Block a user