-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoperators.go
More file actions
24 lines (20 loc) · 806 Bytes
/
operators.go
File metadata and controls
24 lines (20 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package cel2sql
import (
"github.com/google/cel-go/common/operators"
)
// standardSQLBinaryOperators maps CEL binary operators to PostgreSQL SQL operators
var standardSQLBinaryOperators = map[string]string{
operators.LogicalAnd: "AND",
operators.LogicalOr: "OR",
operators.Equals: "=",
}
// standardSQLUnaryOperators maps CEL unary operators to PostgreSQL SQL operators
var standardSQLUnaryOperators = map[string]string{
operators.LogicalNot: "NOT ",
}
// standardSQLFunctions maps CEL function names to PostgreSQL function names
var standardSQLFunctions = map[string]string{
operators.Modulo: "MOD",
// Note: overloads.StartsWith and overloads.EndsWith are handled specially in visitCallFunc
// Note: overloads.Matches is handled specially in visitCallFunc with RE2 to POSIX conversion
}