ArrayBaseType returns the base type of an array type.
()
| 150 | |
| 151 | // ArrayBaseType returns the base type of an array type. |
| 152 | func (t *DoltgresType) ArrayBaseType() *DoltgresType { |
| 153 | if !t.IsArrayType() { |
| 154 | return t |
| 155 | } |
| 156 | // Some array types have no declared element type for pg_catalog compatibility, but still have a logical type |
| 157 | // we return for analysis. |
| 158 | if t.ID == AnyArray.ID { |
| 159 | return AnyElement |
| 160 | } |
| 161 | return t.Elem.WithAttTypMod(t.attTypMod) |
| 162 | } |
| 163 | |
| 164 | // BaseType returns a base type of given array or vector type. |
| 165 | // If this type does not have base type, it returns itself. |
no test coverage detected