support for connect with connection string (#19355)

* wip

* WIP

* radio button

* handle connection string

* fix test

* fix test

* fix test cases

* remember password

* pr comments

* pr comments
This commit is contained in:
Alan Ren
2022-05-13 14:48:12 -07:00
committed by GitHub
parent 128767c713
commit b8858f011d
12 changed files with 301 additions and 161 deletions

View File

@@ -20,6 +20,20 @@ export const clientCapabilities = {
hostVersion: HOST_VERSION
};
/**
* The connection string options for connection provider.
*/
export interface ConnectionStringOptions {
/**
* Whether the connection provider supports connection string as an input option. The default value is false.
*/
isEnabled?: boolean;
/**
* Whether the connection provider uses connection string as the default option to connect. The default value is false.
*/
isDefault?: boolean;
}
export interface ConnectionProviderProperties {
providerId: string;
iconPath?: URI | IconPath | { id: string, path: IconPath, default?: boolean }[]
@@ -29,6 +43,7 @@ export interface ConnectionProviderProperties {
connectionOptions: azdata.ConnectionOption[];
isQueryProvider?: boolean;
supportedExecutionPlanFileExtensions?: string[];
connectionStringOptions?: ConnectionStringOptions;
}
export interface ProviderFeatures {

View File

@@ -40,6 +40,10 @@ export class CapabilitiesService extends Disposable implements ICapabilitiesServ
}
// By default isQueryProvider is true.
provider.connection.isQueryProvider = provider.connection.isQueryProvider !== false;
provider.connection.connectionStringOptions = {
isEnabled: !!(provider.connection.connectionStringOptions?.isEnabled),
isDefault: !!(provider.connection.connectionStringOptions?.isDefault)
};
this._onCapabilitiesRegistered.fire({ id, features: provider });
}