pgTextPath writes the JSON path in PostgreSQL text format: `"a"->'b'->>'c'`.
(b *sql.Builder)
| 570 | |
| 571 | // pgTextPath writes the JSON path in PostgreSQL text format: `"a"->'b'->>'c'`. |
| 572 | func (p *PathOptions) pgTextPath(b *sql.Builder) { |
| 573 | b.Ident(p.Ident) |
| 574 | for i, s := range p.Path { |
| 575 | b.WriteString("->") |
| 576 | if p.Unquote && i == len(p.Path)-1 { |
| 577 | b.WriteString(">") |
| 578 | } |
| 579 | if idx, ok := isJSONIdx(s); ok { |
| 580 | b.WriteString(idx) |
| 581 | } else { |
| 582 | b.WriteString("'" + s + "'") |
| 583 | } |
| 584 | } |
| 585 | } |
| 586 | |
| 587 | // pgArrayPath writes the JSON path in PostgreSQL array text[] format: '{a,1,b}'. |
| 588 | func (p *PathOptions) pgArrayPath(b *sql.Builder) { |
no test coverage detected