mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 01:25:37 -05:00
Set target platform for db projects from server metadata: mssql vscode extension (#20607)
* Set target platform for mssql vscode extension- create project from db feature * Addressed comments * Address comment to add EngineEdition information in vscode-mssql.d.ts
This commit is contained in:
@@ -1420,7 +1420,7 @@ export class ProjectsController {
|
||||
}
|
||||
const model = await createNewProjectFromDatabaseWithQuickpick(profile as mssqlVscode.IConnectionInfo);
|
||||
if (model) {
|
||||
await this.createProjectFromDatabaseCallback(model);
|
||||
await this.createProjectFromDatabaseCallback(model, profile as mssqlVscode.IConnectionInfo);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
@@ -1431,13 +1431,22 @@ export class ProjectsController {
|
||||
return new CreateProjectFromDatabaseDialog(profile);
|
||||
}
|
||||
|
||||
public async createProjectFromDatabaseCallback(model: ImportDataModel, connectionId?: string) {
|
||||
public async createProjectFromDatabaseCallback(model: ImportDataModel, connectionInfo?: string | mssqlVscode.IConnectionInfo) {
|
||||
try {
|
||||
|
||||
const newProjFolderUri = model.filePath;
|
||||
let targetPlatform: SqlTargetPlatform | undefined;
|
||||
if (connectionId) {
|
||||
targetPlatform = await utils.getTargetPlatformFromServerVersion(connectionId);
|
||||
let serverInfo;
|
||||
if (connectionInfo) {
|
||||
if (typeof connectionInfo === 'string') {
|
||||
serverInfo = await utils.getAzdataApi()!.connection.getServerInfo(connectionInfo);
|
||||
} else {
|
||||
serverInfo = (await utils.getVscodeMssqlApi()).getServerInfo(connectionInfo);
|
||||
}
|
||||
}
|
||||
|
||||
if (serverInfo) {
|
||||
targetPlatform = await utils.getTargetPlatformFromServerVersion(serverInfo);
|
||||
}
|
||||
|
||||
const newProjFilePath = await this.createNewProject({
|
||||
|
||||
Reference in New Issue
Block a user