NewBitType returns a Bit type with type modifier set representing the number of bits in the string.
(width int32)
| 67 | // NewBitType returns a Bit type with type modifier set |
| 68 | // representing the number of bits in the string. |
| 69 | func 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. |
nothing calls this directly
no test coverage detected