NewNumericTypeWithPrecisionAndScale returns Numeric type with typmod set.
(precision, scale int32)
| 79 | |
| 80 | // NewNumericTypeWithPrecisionAndScale returns Numeric type with typmod set. |
| 81 | func NewNumericTypeWithPrecisionAndScale(precision, scale int32) (*DoltgresType, error) { |
| 82 | typmod, err := GetTypmodFromNumericPrecisionAndScale(precision, scale) |
| 83 | if err != nil { |
| 84 | return nil, err |
| 85 | } |
| 86 | newType := *Numeric.WithAttTypMod(typmod) |
| 87 | return &newType, nil |
| 88 | } |
| 89 | |
| 90 | // GetTypmodFromNumericPrecisionAndScale takes Numeric type precision and scale and returns the type modifier value. |
| 91 | func GetTypmodFromNumericPrecisionAndScale(precision, scale int32) (int32, error) { |
nothing calls this directly
no test coverage detected