IsPrimitive returns true if the data type is a primitive type.
(dt DataType)
| 255 | |
| 256 | // IsPrimitive returns true if the data type is a primitive type. |
| 257 | func IsPrimitive(dt DataType) bool { |
| 258 | switch t := dt.(type) { |
| 259 | case Primitive: |
| 260 | return true |
| 261 | case *UserTypeExpr: |
| 262 | return IsPrimitive(t.Type) |
| 263 | case *ResultTypeExpr: |
| 264 | return IsPrimitive(t.Type) |
| 265 | default: |
| 266 | return false |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | // IsAlias returns true if the data type is a user type backed by a primitive |
| 271 | // type (so call aliased type). |
no outgoing calls