@@ -276,6 +276,16 @@ func TypeFromProto(t *proto.Type) Type {
276276 TypeVariationRef : t .IntervalDay .TypeVariationReference ,
277277 Precision : precision ,
278278 }
279+ case * proto.Type_IntervalCompound_ :
280+ precision , err := ProtoToTimePrecision (t .IntervalCompound .Precision )
281+ if err != nil {
282+ panic (fmt .Sprintf ("Invalid precision %v" , err ))
283+ }
284+ return & IntervalCompoundType {
285+ nullability : t .IntervalCompound .Nullability ,
286+ typeVariationRef : t .IntervalCompound .TypeVariationReference ,
287+ precision : precision ,
288+ }
279289 case * proto.Type_TimestampTz :
280290 return & TimestampTzType {
281291 Nullability : t .TimestampTz .Nullability ,
@@ -311,6 +321,26 @@ func TypeFromProto(t *proto.Type) Type {
311321 Scale : t .Decimal .Scale ,
312322 Precision : t .Decimal .Precision ,
313323 }
324+ case * proto.Type_PrecisionTimestamp_ :
325+ precision , err := ProtoToTimePrecision (t .PrecisionTimestamp .Precision )
326+ if err != nil {
327+ panic (fmt .Sprintf ("Invalid precision %v" , err ))
328+ }
329+ return & PrecisionTimestampType {
330+ Nullability : t .PrecisionTimestamp .Nullability ,
331+ TypeVariationRef : t .PrecisionTimestamp .TypeVariationReference ,
332+ Precision : precision ,
333+ }
334+ case * proto.Type_PrecisionTimestampTz :
335+ precision , err := ProtoToTimePrecision (t .PrecisionTimestampTz .Precision )
336+ if err != nil {
337+ panic (fmt .Sprintf ("Invalid precision %v" , err ))
338+ }
339+ return & PrecisionTimestampTzType {PrecisionTimestampType {
340+ Nullability : t .PrecisionTimestampTz .Nullability ,
341+ TypeVariationRef : t .PrecisionTimestampTz .TypeVariationReference ,
342+ Precision : precision ,
343+ }}
314344 case * proto.Type_Struct_ :
315345 fields := make ([]Type , len (t .Struct .Types ))
316346 for i , f := range t .Struct .Types {
@@ -655,6 +685,13 @@ func TypeToProto(t Type) *proto.Type {
655685 Precision : & precision ,
656686 Nullability : t .Nullability ,
657687 TypeVariationReference : t .TypeVariationRef }}}
688+ case IntervalCompoundType :
689+ precision := t .precision .ToProtoVal ()
690+ return & proto.Type {Kind : & proto.Type_IntervalCompound_ {
691+ IntervalCompound : & proto.Type_IntervalCompound {
692+ Precision : precision ,
693+ Nullability : t .nullability ,
694+ TypeVariationReference : t .typeVariationRef }}}
658695 case * UUIDType :
659696 return & proto.Type {Kind : & proto.Type_Uuid {
660697 Uuid : & proto.Type_UUID {
@@ -680,6 +717,18 @@ func TypeToProto(t Type) *proto.Type {
680717 TypeVariationReference : t .TypeVariationRef }}}
681718 case * DecimalType :
682719 return t .ToProto ()
720+ case * PrecisionTimestampType :
721+ return & proto.Type {Kind : & proto.Type_PrecisionTimestamp_ {
722+ PrecisionTimestamp : & proto.Type_PrecisionTimestamp {
723+ Precision : int32 (t .Precision ),
724+ Nullability : t .Nullability ,
725+ TypeVariationReference : t .TypeVariationRef }}}
726+ case * PrecisionTimestampTzType :
727+ return & proto.Type {Kind : & proto.Type_PrecisionTimestampTz {
728+ PrecisionTimestampTz : & proto.Type_PrecisionTimestampTZ {
729+ Precision : int32 (t .Precision ),
730+ Nullability : t .Nullability ,
731+ TypeVariationReference : t .TypeVariationRef }}}
683732 case * StructType :
684733 return t .ToProto ()
685734 case * ListType :
0 commit comments