mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 09:59:47 -05:00
List connections for sql proj publish quickpick (#16233)
* List connections for sql proj publish quickpick * cleanup
This commit is contained in:
@@ -256,16 +256,20 @@ export type IDacFxService = mssql.IDacFxService | vscodeMssql.IDacFxService;
|
||||
|
||||
export async function getDacFxService(): Promise<IDacFxService> {
|
||||
if (getAzdataApi()) {
|
||||
let ext = vscode.extensions.getExtension(mssql.extension.name) as vscode.Extension<mssql.IExtension>;
|
||||
const ext = vscode.extensions.getExtension(mssql.extension.name) as vscode.Extension<mssql.IExtension>;
|
||||
const api = await ext.activate();
|
||||
return api.dacFx;
|
||||
} else {
|
||||
let ext = vscode.extensions.getExtension(vscodeMssql.extension.name) as vscode.Extension<vscodeMssql.IExtension>;
|
||||
const api = await ext.activate();
|
||||
const api = await getVscodeMssqlApi();
|
||||
return api.dacFx;
|
||||
}
|
||||
}
|
||||
|
||||
export async function getVscodeMssqlApi(): Promise<vscodeMssql.IExtension> {
|
||||
const ext = vscode.extensions.getExtension(vscodeMssql.extension.name) as vscode.Extension<vscodeMssql.IExtension>;
|
||||
return ext.activate();
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the default deployment options from DacFx
|
||||
*/
|
||||
|
||||
@@ -9,6 +9,7 @@ import { IGenerateScriptSettings, IPublishSettings } from '../models/IPublishSet
|
||||
import { Project } from '../models/project';
|
||||
import { PublishProfile, readPublishProfile } from '../models/publishProfile/publishProfile';
|
||||
import { promptForPublishProfile } from './publishDatabaseDialog';
|
||||
import { getVscodeMssqlApi } from '../common/utils';
|
||||
|
||||
/**
|
||||
* Create flow for Publishing a database using only VS Code-native APIs such as QuickPick
|
||||
@@ -70,10 +71,8 @@ export async function launchPublishDatabaseQuickpick(project: Project): Promise<
|
||||
}
|
||||
|
||||
// 2. Select connection
|
||||
// TODO@chgagnon: Hook up to MSSQL
|
||||
const connectionProfile = await vscode.window.showQuickPick(
|
||||
['Connection 1', 'Connection 2', 'Create New Connection'],
|
||||
{ title: constants.selectConnection, ignoreFocusOut: true });
|
||||
const api = await getVscodeMssqlApi();
|
||||
const connectionProfile = await api.promptForConnection();
|
||||
if (!connectionProfile) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,178 @@ declare module 'vscode-mssql' {
|
||||
*/
|
||||
export interface IExtension {
|
||||
|
||||
/**
|
||||
* Service for accessing DacFx functionality
|
||||
*/
|
||||
readonly dacFx: IDacFxService;
|
||||
|
||||
/**
|
||||
* Prompts the user to select an existing connection or create a new one, and then returns the result
|
||||
*/
|
||||
promptForConnection(): Promise<IConnectionInfo | undefined>
|
||||
}
|
||||
|
||||
/**
|
||||
* Information about a database connection
|
||||
*/
|
||||
export interface IConnectionInfo {
|
||||
/**
|
||||
* server name
|
||||
*/
|
||||
server: string;
|
||||
|
||||
/**
|
||||
* database name
|
||||
*/
|
||||
database: string;
|
||||
|
||||
/**
|
||||
* user name
|
||||
*/
|
||||
user: string;
|
||||
|
||||
/**
|
||||
* password
|
||||
*/
|
||||
password: string;
|
||||
|
||||
/**
|
||||
* email
|
||||
*/
|
||||
email: string;
|
||||
|
||||
/**
|
||||
* accountId
|
||||
*/
|
||||
accountId: string;
|
||||
|
||||
/**
|
||||
* The port number to connect to.
|
||||
*/
|
||||
port: number;
|
||||
|
||||
/**
|
||||
* Gets or sets the authentication to use.
|
||||
*/
|
||||
authenticationType: string;
|
||||
|
||||
/**
|
||||
* Gets or sets the azure account token to use.
|
||||
*/
|
||||
azureAccountToken: string;
|
||||
|
||||
/**
|
||||
* Gets or sets a Boolean value that indicates whether SQL Server uses SSL encryption for all data sent between the client and server if
|
||||
* the server has a certificate installed.
|
||||
*/
|
||||
encrypt: boolean;
|
||||
|
||||
/**
|
||||
* Gets or sets a value that indicates whether the channel will be encrypted while bypassing walking the certificate chain to validate trust.
|
||||
*/
|
||||
trustServerCertificate: boolean;
|
||||
|
||||
/**
|
||||
* Gets or sets a Boolean value that indicates if security-sensitive information, such as the password, is not returned as part of the connection
|
||||
* if the connection is open or has ever been in an open state.
|
||||
*/
|
||||
persistSecurityInfo: boolean;
|
||||
|
||||
/**
|
||||
* Gets or sets the length of time (in seconds) to wait for a connection to the server before terminating the attempt and generating an error.
|
||||
*/
|
||||
connectTimeout: number;
|
||||
|
||||
/**
|
||||
* The number of reconnections attempted after identifying that there was an idle connection failure.
|
||||
*/
|
||||
connectRetryCount: number;
|
||||
|
||||
/**
|
||||
* Amount of time (in seconds) between each reconnection attempt after identifying that there was an idle connection failure.
|
||||
*/
|
||||
connectRetryInterval: number;
|
||||
|
||||
/**
|
||||
* Gets or sets the name of the application associated with the connection string.
|
||||
*/
|
||||
applicationName: string;
|
||||
|
||||
/**
|
||||
* Gets or sets the name of the workstation connecting to SQL Server.
|
||||
*/
|
||||
workstationId: string;
|
||||
|
||||
/**
|
||||
* Declares the application workload type when connecting to a database in an SQL Server Availability Group.
|
||||
*/
|
||||
applicationIntent: string;
|
||||
|
||||
/**
|
||||
* Gets or sets the SQL Server Language record name.
|
||||
*/
|
||||
currentLanguage: string;
|
||||
|
||||
/**
|
||||
* Gets or sets a Boolean value that indicates whether the connection will be pooled or explicitly opened every time that the connection is requested.
|
||||
*/
|
||||
pooling: boolean;
|
||||
|
||||
/**
|
||||
* Gets or sets the maximum number of connections allowed in the connection pool for this specific connection string.
|
||||
*/
|
||||
maxPoolSize: number;
|
||||
|
||||
/**
|
||||
* Gets or sets the minimum number of connections allowed in the connection pool for this specific connection string.
|
||||
*/
|
||||
minPoolSize: number;
|
||||
|
||||
/**
|
||||
* Gets or sets the minimum time, in seconds, for the connection to live in the connection pool before being destroyed.
|
||||
*/
|
||||
loadBalanceTimeout: number;
|
||||
|
||||
/**
|
||||
* Gets or sets a Boolean value that indicates whether replication is supported using the connection.
|
||||
*/
|
||||
replication: boolean;
|
||||
|
||||
/**
|
||||
* Gets or sets a string that contains the name of the primary data file. This includes the full path name of an attachable database.
|
||||
*/
|
||||
attachDbFilename: string;
|
||||
|
||||
/**
|
||||
* Gets or sets the name or address of the partner server to connect to if the primary server is down.
|
||||
*/
|
||||
failoverPartner: string;
|
||||
|
||||
/**
|
||||
* If your application is connecting to an AlwaysOn availability group (AG) on different subnets, setting MultiSubnetFailover=true
|
||||
* provides faster detection of and connection to the (currently) active server.
|
||||
*/
|
||||
multiSubnetFailover: boolean;
|
||||
|
||||
/**
|
||||
* When true, an application can maintain multiple active result sets (MARS).
|
||||
*/
|
||||
multipleActiveResultSets: boolean;
|
||||
|
||||
/**
|
||||
* Gets or sets the size in bytes of the network packets used to communicate with an instance of SQL Server.
|
||||
*/
|
||||
packetSize: number;
|
||||
|
||||
/**
|
||||
* Gets or sets a string value that indicates the type system the application expects.
|
||||
*/
|
||||
typeSystemVersion: string;
|
||||
|
||||
/**
|
||||
* Gets or sets the connection string to use for this connection.
|
||||
*/
|
||||
connectionString: string;
|
||||
}
|
||||
|
||||
export const enum ExtractTarget {
|
||||
|
||||
Reference in New Issue
Block a user