MCPcopy Index your code
hub / github.com/sqlc-dev/sqlc / Format

Method Format

internal/sql/ast/scalar_array_op_expr.go:18–35  ·  view source on GitHub ↗
(buf *TrackedBuffer, d format.Dialect)

Source from the content-addressed store, hash-verified

16}
17
18func (n *ScalarArrayOpExpr) Format(buf *TrackedBuffer, d format.Dialect) {
19 if n == nil {
20 return
21 }
22 // ScalarArrayOpExpr represents "scalar op ANY/ALL (array)"
23 // Args[0] is the left operand, Args[1] is the array
24 if n.Args != nil && len(n.Args.Items) >= 2 {
25 buf.astFormat(n.Args.Items[0], d)
26 buf.WriteString(" = ") // TODO: Use actual operator based on Opno
27 if n.UseOr {
28 buf.WriteString("ANY(")
29 } else {
30 buf.WriteString("ALL(")
31 }
32 buf.astFormat(n.Args.Items[1], d)
33 buf.WriteString(")")
34 }
35}

Callers

nothing calls this directly

Calls 1

astFormatMethod · 0.80

Tested by

no test coverage detected