Skip to content

Commit

Permalink
Fix server determination logic (#25812)
Browse files Browse the repository at this point in the history
  • Loading branch information
zijchen authored Aug 7, 2024
1 parent 0acb8df commit dfbd2d2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions extensions/sql-database-projects/src/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -729,8 +729,10 @@ export async function getTargetPlatformFromServerVersion(serverInfo: azdataType.
const engineEdition = serverInfo.engineEditionId;
const azdataApi = getAzdataApi();
if (azdataApi) {
if (engineEdition === azdataApi.DatabaseEngineEdition.SqlOnDemand) {
targetPlatform = isSqlDwUnifiedServer(serverUrl) ? SqlTargetPlatform.sqlDwUnified : SqlTargetPlatform.sqlDwServerless;
if (isSqlDwUnifiedServer(serverUrl)) {
targetPlatform = SqlTargetPlatform.sqlDwUnified;
} else if (engineEdition === azdataApi.DatabaseEngineEdition.SqlOnDemand) {
targetPlatform = SqlTargetPlatform.sqlDwServerless;
} else if (engineEdition === azdataApi.DatabaseEngineEdition.SqlDbFabric) {
targetPlatform = SqlTargetPlatform.sqlDbFabric;
} else if (engineEdition === azdataApi.DatabaseEngineEdition.SqlDataWarehouse) {
Expand All @@ -739,8 +741,10 @@ export async function getTargetPlatformFromServerVersion(serverInfo: azdataType.
targetPlatform = SqlTargetPlatform.sqlAzure;
}
} else {
if (engineEdition === vscodeMssql.DatabaseEngineEdition.SqlOnDemand) {
targetPlatform = isSqlDwUnifiedServer(serverUrl) ? SqlTargetPlatform.sqlDwUnified : SqlTargetPlatform.sqlDwServerless;
if (isSqlDwUnifiedServer(serverUrl)) {
targetPlatform = SqlTargetPlatform.sqlDwUnified;
} else if (engineEdition === vscodeMssql.DatabaseEngineEdition.SqlOnDemand) {
targetPlatform = SqlTargetPlatform.sqlDwServerless;
} else if (engineEdition === vscodeMssql.DatabaseEngineEdition.SqlDbFabric) {
targetPlatform = SqlTargetPlatform.sqlDbFabric;
} else if (engineEdition === vscodeMssql.DatabaseEngineEdition.SqlDataWarehouse) {
Expand Down

0 comments on commit dfbd2d2

Please sign in to comment.