MCPcopy Index your code
hub / github.com/ent/ent / pgArrayPath

Method pgArrayPath

dialect/sql/sqljson/sqljson.go:588–600  ·  view source on GitHub ↗

pgArrayPath writes the JSON path in PostgreSQL array text[] format: '{a,1,b}'.

(b *sql.Builder)

Source from the content-addressed store, hash-verified

586
587// pgArrayPath writes the JSON path in PostgreSQL array text[] format: '{a,1,b}'.
588func (p *PathOptions) pgArrayPath(b *sql.Builder) {
589 b.WriteString("'{")
590 for i, s := range p.Path {
591 if i > 0 {
592 b.Comma()
593 }
594 if idx, ok := isJSONIdx(s); ok {
595 s = idx
596 }
597 b.WriteString(s)
598 }
599 b.WriteString("}'")
600}
601
602// ParsePath parses the "dotpath" for the DotPath option.
603//

Callers 1

AppendMethod · 0.80

Calls 3

isJSONIdxFunction · 0.85
WriteStringMethod · 0.80
CommaMethod · 0.80

Tested by

no test coverage detected