MCPcopy Index your code
hub / github.com/coder/coder / SQLString

Method SQLString

coderd/rbac/regosql/sqltypes/binary.go:58–77  ·  view source on GitHub ↗
(cfg *SQLGenerator)

Source from the content-addressed store, hash-verified

56}
57
58func (b binaryOp) SQLString(cfg *SQLGenerator) string {
59 sqlOp := ""
60 switch b.op {
61 case binaryOpOR:
62 sqlOp = "OR"
63 case binaryOpAND:
64 sqlOp = "AND"
65 default:
66 cfg.AddError(xerrors.Errorf("unsupported binary operator: %s (%d)", b.source, b.op))
67 return "BinaryOpError"
68 }
69
70 terms := make([]string, 0, len(b.Terms))
71 for _, term := range b.Terms {
72 termSQL := term.SQLString(cfg)
73 terms = append(terms, termSQL)
74 }
75
76 return strings.Join(terms, " "+sqlOp+" ")
77}

Callers

nothing calls this directly

Calls 3

AddErrorMethod · 0.65
SQLStringMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected