Format implements the Datum interface.
(ctx *FmtCtx)
| 5749 | |
| 5750 | // Format implements the Datum interface. |
| 5751 | func (d *DOid) Format(ctx *FmtCtx) { |
| 5752 | if ctx.HasFlags(FmtPgwireText) && d.semanticType.Oid() != oid.T_oid && d.Oid == UnknownOidValue { |
| 5753 | // Special case for the "unknown" oid. |
| 5754 | ctx.WriteString(UnknownOidName) |
| 5755 | } else if d.semanticType.Oid() == oid.T_oid || d.name == "" { |
| 5756 | ctx.Write(strconv.AppendUint(ctx.scratch[:0], uint64(d.Oid), 10)) |
| 5757 | } else if ctx.HasFlags(fmtDisambiguateDatumTypes) { |
| 5758 | ctx.WriteString("crdb_internal.create_") |
| 5759 | ctx.WriteString(d.semanticType.SQLStandardName()) |
| 5760 | ctx.WriteByte('(') |
| 5761 | ctx.Write(strconv.AppendUint(ctx.scratch[:0], uint64(d.Oid), 10)) |
| 5762 | ctx.WriteByte(',') |
| 5763 | lexbase.EncodeSQLStringWithFlags(&ctx.Buffer, d.name, lexbase.EncNoFlags) |
| 5764 | ctx.WriteByte(')') |
| 5765 | } else { |
| 5766 | // This is used to print the name of pseudo-procedures in e.g. |
| 5767 | // pg_catalog.pg_type.typinput |
| 5768 | lexbase.EncodeSQLStringWithFlags(&ctx.Buffer, d.name, lexbase.EncBareStrings) |
| 5769 | } |
| 5770 | } |
| 5771 | |
| 5772 | // IsMax implements the Datum interface. |
| 5773 | func (d *DOid) IsMax(ctx context.Context, cmpCtx CompareContext) bool { |
nothing calls this directly
no test coverage detected