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

Function NewTimeType

server/types/time.go:66–73  ·  view source on GitHub ↗

NewTimeType returns Time type with typmod set. // TODO: implement precision

(precision int32)

Source from the content-addressed store, hash-verified

64
65// NewTimeType returns Time type with typmod set. // TODO: implement precision
66func NewTimeType(precision int32) (*DoltgresType, error) {
67 typmod, err := GetTypmodFromTimePrecision(precision)
68 if err != nil {
69 return nil, err
70 }
71 newType := *Time.WithAttTypMod(typmod)
72 return &newType, nil
73}
74
75// GetTypmodFromTimePrecision takes Time type precision and returns the type modifier value.
76func GetTypmodFromTimePrecision(precision int32) (int32, error) {

Callers

nothing calls this directly

Calls 2

WithAttTypModMethod · 0.80

Tested by

no test coverage detected