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

Function NewBitType

server/types/bit.go:69–77  ·  view source on GitHub ↗

NewBitType returns a Bit type with type modifier set representing the number of bits in the string.

(width int32)

Source from the content-addressed store, hash-verified

67// NewBitType returns a Bit type with type modifier set
68// representing the number of bits in the string.
69func NewBitType(width int32) (*DoltgresType, error) {
70 if width < 1 {
71 return nil, ErrLengthMustBeAtLeast1.New("bit")
72 } else if width > StringMaxLength {
73 return nil, ErrLengthCannotExceed.New("bit")
74 }
75 newType := *Bit.WithAttTypMod(width)
76 return &newType, nil
77}
78
79// serializeTypeBit handles serialization from the standard representation to our serialized representation that is
80// written in Dolt.

Callers

nothing calls this directly

Calls 1

WithAttTypModMethod · 0.80

Tested by

no test coverage detected