Skip to content
Snippets Groups Projects
Commit 73200427 authored by Hemming,J. (Jacob)'s avatar Hemming,J. (Jacob)
Browse files

Merge branch '318-add-attribute-operators' into 'develop'

318 add attribute operators

See merge request datastrophe/microservices-backbone/query-service!18
parents aa7adc74 e0e29499
No related branches found
No related tags found
No related merge requests found
......@@ -44,24 +44,30 @@ func createConstraintBoolExpression(constraint *entity.QueryConstraintStruct, na
line string
)
// Constraint datatypes back end
// text MatchTypes: EQ/NEQ/contains/excludes
// number MatchTypes: EQ/NEQ/GT/LT/GET/LET
// bool MatchTypes: EQ/NEQ
switch constraint.DataType {
case "text":
value = fmt.Sprintf("\"%s\"", constraint.Value)
switch constraint.MatchType {
case "NEQ":
match = "!="
case "contains":
match = "IN"
case "startswith":
match = "LIKE"
case "excludes":
match = "NOT LIKE"
value = fmt.Sprintf("\"%s%%\"", constraint.Value)
case "endswith":
match = "LIKE"
value = fmt.Sprintf("\"_%s\"", constraint.Value)
default: //exact
default: //EQ
match = "=="
}
case "number":
value = constraint.Value
switch constraint.MatchType {
case "NEQ":
match = "!="
case "GT":
match = ">"
case "LT":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment