Skip to content

Commit

Permalink
Adding Fabric SQL Mirrored support to SQL Projects
Browse files Browse the repository at this point in the history
  • Loading branch information
ssreerama committed Jul 25, 2024
1 parent 1c4f38c commit 945f749
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion extensions/sql-database-projects/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build">
<Sdk Name="Microsoft.Build.Sql" Version="0.1.7-preview" />
<Sdk Name="Microsoft.Build.Sql" Version="0.2.0-preview" />
<PropertyGroup>
<Name>@@PROJECT_NAME@@</Name>
<ProjectGuid>{@@PROJECT_GUID@@}</ProjectGuid>
Expand Down
3 changes: 2 additions & 1 deletion extensions/sql-database-projects/src/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,8 @@ export const targetPlatformToVersion: Map<string, string> = new Map<string, stri
[SqlTargetPlatform.sqlAzure, 'AzureV12'],
[SqlTargetPlatform.sqlDW, 'Dw'],
[SqlTargetPlatform.sqlDwServerless, 'Serverless'],
[SqlTargetPlatform.sqlDwUnified, 'DwUnified']
[SqlTargetPlatform.sqlDwUnified, 'DwUnified'],
[SqlTargetPlatform.sqlDbFabric, 'DbFabric']
]);

export const onPremServerVersionToTargetPlatform: Map<number, SqlTargetPlatform> = new Map<number, SqlTargetPlatform>([
Expand Down
8 changes: 4 additions & 4 deletions extensions/sql-database-projects/src/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion extensions/sql-database-projects/src/sqldbproj.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion extensions/sql-database-projects/src/tools/buildHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class BuildHelper {

public async ensureDacFxDllsPresence(outputChannel: vscode.OutputChannel): Promise<boolean> {
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',
Expand Down
3 changes: 2 additions & 1 deletion extensions/types/vscode-mssql.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ declare module 'vscode-mssql' {
SqlDataWarehouse = 6,
SqlStretchDatabase = 7,
SqlManagedInstance = 8,
SqlOnDemand = 11
SqlOnDemand = 11,
SqlDbFabric = 12
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/sql/azdata.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,8 @@ declare module 'azdata' {
SqlDataWarehouse = 6,
SqlStretchDatabase = 7,
SqlManagedInstance = 8,
SqlOnDemand = 11
SqlOnDemand = 11,
SqlDbFabric = 12
}

export interface DataProvider {
Expand Down
3 changes: 2 additions & 1 deletion src/sql/workbench/api/common/sqlExtHostTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@ export enum DatabaseEngineEdition {
SqlDataWarehouse = 6,
SqlStretchDatabase = 7,
SqlManagedInstance = 8,
SqlOnDemand = 11
SqlOnDemand = 11,
SqlDbFabric = 12
}

export interface ToolbarLayout {
Expand Down

0 comments on commit 945f749

Please sign in to comment.