Format implements the NodeFormatter interface.
(ctx *FmtCtx)
| 582 | |
| 583 | // Format implements the NodeFormatter interface. |
| 584 | func (d *DBitArray) Format(ctx *FmtCtx) { |
| 585 | f := ctx.flags |
| 586 | if f.HasFlags(fmtPgwireFormat) { |
| 587 | d.BitArray.Format(&ctx.Buffer) |
| 588 | } else { |
| 589 | withQuotes := !f.HasFlags(FmtFlags(lex.EncBareStrings)) |
| 590 | if withQuotes { |
| 591 | ctx.WriteString("B'") |
| 592 | } |
| 593 | d.BitArray.Format(&ctx.Buffer) |
| 594 | if withQuotes { |
| 595 | ctx.WriteByte('\'') |
| 596 | } |
| 597 | } |
| 598 | } |
| 599 | |
| 600 | // Size implements the Datum interface. |
| 601 | func (d *DBitArray) Size() uintptr { |