From 945f74915e77dc3f823a5cb57c1a2e8c1bcfc465 Mon Sep 17 00:00:00 2001 From: "Sai Avishkar Sreerama (from Dev Box)" Date: Thu, 25 Jul 2024 18:23:11 -0500 Subject: [PATCH] Adding Fabric SQL Mirrored support to SQL Projects --- extensions/sql-database-projects/README.md | 2 +- .../resources/templates/newSdkSqlProjectTemplate.xml | 2 +- extensions/sql-database-projects/src/common/constants.ts | 3 ++- extensions/sql-database-projects/src/common/utils.ts | 8 ++++---- extensions/sql-database-projects/src/sqldbproj.d.ts | 3 ++- extensions/sql-database-projects/src/tools/buildHelper.ts | 2 +- extensions/types/vscode-mssql.d.ts | 3 ++- src/sql/azdata.d.ts | 3 ++- src/sql/workbench/api/common/sqlExtHostTypes.ts | 3 ++- 9 files changed, 17 insertions(+), 12 deletions(-) diff --git a/extensions/sql-database-projects/README.md b/extensions/sql-database-projects/README.md index 38f8c2cbc17e..0a97ab014de8 100644 --- a/extensions/sql-database-projects/README.md +++ b/extensions/sql-database-projects/README.md @@ -35,7 +35,7 @@ Learn more about the SQL Database Projects extension in the documentation: https ### General Settings - `sqlDatabaseProjects.dotnetSDK Location`: The path to the folder containing the `dotnet` folder for the .NET SDK. If not set, the extension will attempt to find the .NET SDK on the system. -- `sqlDatabaseProjects.microsoftBuildSqlVersion`: Version of Microsoft.Build.Sql binaries used when building SQL projects that are not SDK-style SQL projects. If not set, the extension will use Microsoft.Build.Sql 0.1.12-preview. +- `sqlDatabaseProjects.microsoftBuildSqlVersion`: Version of Microsoft.Build.Sql binaries used when building SQL projects that are not SDK-style SQL projects. If not set, the extension will use Microsoft.Build.Sql 0.2.0-preview. - `sqlDatabaseProjects.netCoreDoNotAsk`: When true, no longer prompts to install .NET SDK when a supported installation is not found. - `sqlDatabaseProjects.collapseProjectNodes`: Option to set the default state of the project nodes in the database projects view to collapsed. If not set, the extension will default to expanded. diff --git a/extensions/sql-database-projects/resources/templates/newSdkSqlProjectTemplate.xml b/extensions/sql-database-projects/resources/templates/newSdkSqlProjectTemplate.xml index 404b8b62f63f..6b108ac8bd42 100644 --- a/extensions/sql-database-projects/resources/templates/newSdkSqlProjectTemplate.xml +++ b/extensions/sql-database-projects/resources/templates/newSdkSqlProjectTemplate.xml @@ -1,6 +1,6 @@ - + @@PROJECT_NAME@@ {@@PROJECT_GUID@@} diff --git a/extensions/sql-database-projects/src/common/constants.ts b/extensions/sql-database-projects/src/common/constants.ts index dbde0166072a..dc95eabad948 100644 --- a/extensions/sql-database-projects/src/common/constants.ts +++ b/extensions/sql-database-projects/src/common/constants.ts @@ -625,7 +625,8 @@ export const targetPlatformToVersion: Map = new Map = new Map([ diff --git a/extensions/sql-database-projects/src/common/utils.ts b/extensions/sql-database-projects/src/common/utils.ts index 0e2ef694d1e0..45b436680d37 100644 --- a/extensions/sql-database-projects/src/common/utils.ts +++ b/extensions/sql-database-projects/src/common/utils.ts @@ -729,20 +729,20 @@ export async function getTargetPlatformFromServerVersion(serverInfo: azdataType. const engineEdition = serverInfo.engineEditionId; const azdataApi = getAzdataApi(); if (azdataApi) { - // TODO: Update this when Fabric DW gets its own engine edition - // https://github.com/microsoft/azuredatastudio/issues/24112 if (engineEdition === azdataApi.DatabaseEngineEdition.SqlOnDemand) { targetPlatform = isSqlDwUnifiedServer(serverUrl) ? SqlTargetPlatform.sqlDwUnified : SqlTargetPlatform.sqlDwServerless; + } else if (engineEdition === azdataApi.DatabaseEngineEdition.SqlDbFabric) { + targetPlatform = SqlTargetPlatform.sqlDbFabric; } else if (engineEdition === azdataApi.DatabaseEngineEdition.SqlDataWarehouse) { targetPlatform = SqlTargetPlatform.sqlDW; } else { targetPlatform = SqlTargetPlatform.sqlAzure; } } else { - // TODO: Update this when Fabric DW gets its own engine edition - // https://github.com/microsoft/azuredatastudio/issues/24112 if (engineEdition === vscodeMssql.DatabaseEngineEdition.SqlOnDemand) { targetPlatform = isSqlDwUnifiedServer(serverUrl) ? SqlTargetPlatform.sqlDwUnified : SqlTargetPlatform.sqlDwServerless; + } else if (engineEdition === vscodeMssql.DatabaseEngineEdition.SqlDbFabric) { + targetPlatform = SqlTargetPlatform.sqlDbFabric; } else if (engineEdition === vscodeMssql.DatabaseEngineEdition.SqlDataWarehouse) { targetPlatform = SqlTargetPlatform.sqlDW; } else { diff --git a/extensions/sql-database-projects/src/sqldbproj.d.ts b/extensions/sql-database-projects/src/sqldbproj.d.ts index 841e563e25d0..3a98979b7a3d 100644 --- a/extensions/sql-database-projects/src/sqldbproj.d.ts +++ b/extensions/sql-database-projects/src/sqldbproj.d.ts @@ -323,7 +323,8 @@ declare module 'sqldbproj' { sqlDW = 'Azure Synapse SQL Pool', sqlEdge = 'Azure SQL Edge', sqlDwServerless = 'Azure Synapse Serverless SQL Pool', - sqlDwUnified = 'Synapse Data Warehouse in Microsoft Fabric' + sqlDwUnified = 'Synapse Data Warehouse in Microsoft Fabric', + sqlDbFabric = 'Fabric Mirrored SQL Database (Preview)' } export interface ISqlConnectionProperties { diff --git a/extensions/sql-database-projects/src/tools/buildHelper.ts b/extensions/sql-database-projects/src/tools/buildHelper.ts index 54e4e01645c2..f161661ca9d3 100644 --- a/extensions/sql-database-projects/src/tools/buildHelper.ts +++ b/extensions/sql-database-projects/src/tools/buildHelper.ts @@ -56,7 +56,7 @@ export class BuildHelper { public async ensureDacFxDllsPresence(outputChannel: vscode.OutputChannel): Promise { const sdkName = 'Microsoft.Build.Sql'; - const microsoftBuildSqlDefaultVersion = '0.1.14-preview'; // default version of Microsoft.Build.Sql nuget to use for building legacy style projects, update in README when updating this + const microsoftBuildSqlDefaultVersion = '0.2.0-preview'; // default version of Microsoft.Build.Sql nuget to use for building legacy style projects, update in README when updating this const dacFxBuildFiles: string[] = [ 'Microsoft.Data.SqlClient.dll', diff --git a/extensions/types/vscode-mssql.d.ts b/extensions/types/vscode-mssql.d.ts index 75c2959b429a..7422c3264261 100644 --- a/extensions/types/vscode-mssql.d.ts +++ b/extensions/types/vscode-mssql.d.ts @@ -228,7 +228,8 @@ declare module 'vscode-mssql' { SqlDataWarehouse = 6, SqlStretchDatabase = 7, SqlManagedInstance = 8, - SqlOnDemand = 11 + SqlOnDemand = 11, + SqlDbFabric = 12 } /** diff --git a/src/sql/azdata.d.ts b/src/sql/azdata.d.ts index b79619d55001..4d170eff63b5 100644 --- a/src/sql/azdata.d.ts +++ b/src/sql/azdata.d.ts @@ -595,7 +595,8 @@ declare module 'azdata' { SqlDataWarehouse = 6, SqlStretchDatabase = 7, SqlManagedInstance = 8, - SqlOnDemand = 11 + SqlOnDemand = 11, + SqlDbFabric = 12 } export interface DataProvider { diff --git a/src/sql/workbench/api/common/sqlExtHostTypes.ts b/src/sql/workbench/api/common/sqlExtHostTypes.ts index 62f65dffd896..ac040446ff0a 100644 --- a/src/sql/workbench/api/common/sqlExtHostTypes.ts +++ b/src/sql/workbench/api/common/sqlExtHostTypes.ts @@ -460,7 +460,8 @@ export enum DatabaseEngineEdition { SqlDataWarehouse = 6, SqlStretchDatabase = 7, SqlManagedInstance = 8, - SqlOnDemand = 11 + SqlOnDemand = 11, + SqlDbFabric = 12 } export interface ToolbarLayout {