Skip to content

Commit

Permalink
[Service Bus] Remove requiresPreprocessing, compatibilityLevel (Azure…
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a authored Aug 28, 2020
1 parent e057710 commit a412145
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 55 deletions.
2 changes: 0 additions & 2 deletions sdk/servicebus/service-bus/review/service-bus.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,6 @@ export type SqlRuleAction = SqlRuleFilter;

// @public
export interface SqlRuleFilter {
compatibilityLevel?: number;
requiresPreprocessing?: boolean;
sqlExpression?: string;
sqlParameters?: SqlParameter[];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
} from "../util/atomXmlHelper";
import * as Constants from "../util/constants";
import {
getBooleanOrUndefined,
getIntegerOrUndefined,
getString,
getStringOrUndefined,
Expand Down Expand Up @@ -45,9 +44,7 @@ function getTopicFilter(value: any): SqlRuleFilter | CorrelationRuleFilter {
if (value["SqlExpression"] != undefined) {
result = {
sqlExpression: value["SqlExpression"],
sqlParameters: getSqlParametersOrUndefined(value["Parameters"]),
compatibilityLevel: getIntegerOrUndefined(value["CompatibilityLevel"]),
requiresPreprocessing: getBooleanOrUndefined(value["RequiresPreprocessing"])
sqlParameters: getSqlParametersOrUndefined(value["Parameters"])
};
} else {
result = {
Expand All @@ -74,9 +71,7 @@ function getTopicFilter(value: any): SqlRuleFilter | CorrelationRuleFilter {
function getRuleAction(value: any): SqlRuleAction {
return {
sqlExpression: value["SqlExpression"],
sqlParameters: getSqlParametersOrUndefined(value["Parameters"]),
compatibilityLevel: getIntegerOrUndefined(value["CompatibilityLevel"]),
requiresPreprocessing: getBooleanOrUndefined(value["RequiresPreprocessing"])
sqlParameters: getSqlParametersOrUndefined(value["Parameters"])
};
}

Expand Down Expand Up @@ -148,17 +143,6 @@ export interface SqlRuleFilter {
* SQL parameters to the expression
*/
sqlParameters?: SqlParameter[];

/**
* This property is reserved for future use. An integer value showing the
* compatibility level, currently hard-coded to 20.
*/
compatibilityLevel?: number;

/**
* Boolean value indicating whether the SQL filter expression requires preprocessing
*/
requiresPreprocessing?: boolean;
}

/**
Expand All @@ -177,8 +161,7 @@ export class RuleResourceSerializer implements AtomXmlSerializer {
if (rule.filter == undefined) {
// Defaults to creating a true filter if none specified
resource.Filter = {
SqlExpression: "1=1",
CompatibilityLevel: 20
SqlExpression: "1=1"
};
resource.Filter[Constants.XML_METADATA_MARKER] = {
"p4:type": "SqlFilter",
Expand All @@ -189,9 +172,7 @@ export class RuleResourceSerializer implements AtomXmlSerializer {
const sqlFilter: SqlRuleFilter = rule.filter as SqlRuleFilter;
resource.Filter = {
SqlExpression: sqlFilter.sqlExpression,
Parameters: getRawSqlParameters(sqlFilter.sqlParameters),
CompatibilityLevel: 20,
RequiresPreprocessing: getStringOrUndefined(sqlFilter.requiresPreprocessing)
Parameters: getRawSqlParameters(sqlFilter.sqlParameters)
};
resource.Filter[Constants.XML_METADATA_MARKER] = {
"p4:type": "SqlFilter",
Expand Down Expand Up @@ -228,9 +209,7 @@ export class RuleResourceSerializer implements AtomXmlSerializer {
} else {
resource.Action = {
SqlExpression: rule.action.sqlExpression,
Parameters: getRawSqlParameters(rule.action.sqlParameters),
CompatibilityLevel: 20,
RequiresPreprocessing: getStringOrUndefined(rule.action.requiresPreprocessing)
Parameters: getRawSqlParameters(rule.action.sqlParameters)
};
resource.Action[Constants.XML_METADATA_MARKER] = {
"p4:type": "SqlRuleAction",
Expand Down
36 changes: 9 additions & 27 deletions sdk/servicebus/service-bus/test/atomManagement.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1691,15 +1691,11 @@ describe("Atom management - Authentication", function(): void {
output: {
filter: {
sqlExpression: "1=1",
requiresPreprocessing: undefined,
sqlParameters: undefined,
compatibilityLevel: 20
sqlParameters: undefined
},
action: {
sqlExpression: undefined,
requiresPreprocessing: undefined,
sqlParameters: undefined,
compatibilityLevel: undefined
sqlParameters: undefined
},
name: managementRule1
}
Expand All @@ -1722,15 +1718,11 @@ describe("Atom management - Authentication", function(): void {
sqlParameters: [
{ key: "@intParam", value: 1, type: "int" },
{ key: "@stringParam", value: "b", type: "string" }
],
requiresPreprocessing: false,
compatibilityLevel: 20
]
},
action: {
sqlExpression: "SET a='b'",
requiresPreprocessing: false,
sqlParameters: undefined,
compatibilityLevel: 20
sqlParameters: undefined
},
name: managementRule1
}
Expand Down Expand Up @@ -1762,9 +1754,7 @@ describe("Atom management - Authentication", function(): void {
},
action: {
sqlExpression: "SET sys.label='GREEN'",
requiresPreprocessing: false,
sqlParameters: undefined,
compatibilityLevel: 20
sqlParameters: undefined
},
name: managementRule1
}
Expand Down Expand Up @@ -1802,9 +1792,7 @@ describe("Atom management - Authentication", function(): void {
},
action: {
sqlExpression: "SET sys.label='GREEN'",
requiresPreprocessing: false,
sqlParameters: undefined,
compatibilityLevel: 20
sqlParameters: undefined
},
name: managementRule1
}
Expand Down Expand Up @@ -2305,15 +2293,11 @@ describe("Atom management - Authentication", function(): void {
output: {
filter: {
sqlExpression: "stringValue = @stringParam",
sqlParameters: [{ key: "@stringParam", value: "b", type: "string" }],
requiresPreprocessing: false,
compatibilityLevel: 20
sqlParameters: [{ key: "@stringParam", value: "b", type: "string" }]
},
action: {
sqlExpression: "SET a='c'",
requiresPreprocessing: false,
sqlParameters: undefined,
compatibilityLevel: 20
sqlParameters: undefined
},

name: managementRule1
Expand Down Expand Up @@ -2341,9 +2325,7 @@ describe("Atom management - Authentication", function(): void {
},
action: {
sqlExpression: "SET sys.label='RED'",
requiresPreprocessing: false,
sqlParameters: undefined,
compatibilityLevel: 20
sqlParameters: undefined
},

name: managementRule1
Expand Down

0 comments on commit a412145

Please sign in to comment.