MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / Run

Method Run

db/functions/n1ql_function.go:86–104  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

84}
85
86func (fn *n1qlInvocation) Run(ctx context.Context) (any, error) {
87 rows, err := fn.Iterate()
88 if err != nil {
89 return nil, err
90 }
91 defer func() {
92 if rows != nil {
93 _ = rows.Close()
94 }
95 }()
96 result := []any{}
97 var row any
98 for rows.Next(ctx, &row) {
99 result = append(result, row)
100 }
101 err = rows.Close()
102 rows = nil // prevent 'defer' from closing again
103 return result, err
104}

Callers

nothing calls this directly

Calls 3

IterateMethod · 0.95
CloseMethod · 0.65
NextMethod · 0.45

Tested by

no test coverage detected