Numeric creates a numeric value from a string.
(str string)
| 854 | |
| 855 | // Numeric creates a numeric value from a string. |
| 856 | func Numeric(str string) pgtype.Numeric { |
| 857 | numeric := pgtype.Numeric{} |
| 858 | if err := numeric.Scan(str); err != nil { |
| 859 | panic(err) |
| 860 | } |
| 861 | return numeric |
| 862 | } |
| 863 | |
| 864 | // Timestamp is a helper function to convert timestamp strings to pgtype.Timestamp instances. If |
| 865 | // the string cannot be converted, this function will panic. |