NewDatum creates a new Datum from an interface{}.
(in any)
| 2275 | |
| 2276 | // NewDatum creates a new Datum from an interface{}. |
| 2277 | func NewDatum(in any) (d Datum) { |
| 2278 | switch x := in.(type) { |
| 2279 | case []any: |
| 2280 | d.SetValueWithDefaultCollation(MakeDatums(x...)) |
| 2281 | default: |
| 2282 | d.SetValueWithDefaultCollation(in) |
| 2283 | } |
| 2284 | return d |
| 2285 | } |
| 2286 | |
| 2287 | // NewIntDatum creates a new Datum from an int64 value. |
| 2288 | func NewIntDatum(i int64) (d Datum) { |