MCPcopy Create free account
hub / github.com/dolthub/doltgresql / NewCharType

Function NewCharType

server/types/char.go:63–70  ·  view source on GitHub ↗

NewCharType returns BpChar type with typmod set.

(length int32)

Source from the content-addressed store, hash-verified

61
62// NewCharType returns BpChar type with typmod set.
63func NewCharType(length int32) (*DoltgresType, error) {
64 typmod, err := GetTypModFromCharLength("char", length)
65 if err != nil {
66 return nil, err
67 }
68 newType := *BpChar.WithAttTypMod(typmod)
69 return &newType, nil
70}
71
72// serializeTypeBpChar handles serialization from the standard representation to our serialized representation that is
73// written in Dolt.

Callers

nothing calls this directly

Calls 2

GetTypModFromCharLengthFunction · 0.85
WithAttTypModMethod · 0.80

Tested by

no test coverage detected