NewTimeType returns Time type with typmod set. // TODO: implement precision
(precision int32)
| 64 | |
| 65 | // NewTimeType returns Time type with typmod set. // TODO: implement precision |
| 66 | func 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. |
| 76 | func GetTypmodFromTimePrecision(precision int32) (int32, error) { |
nothing calls this directly
no test coverage detected