Skip to content

Commit

Permalink
Merge branch 'main' into numeric/fix-bq-check
Browse files Browse the repository at this point in the history
  • Loading branch information
Amogh-Bharadwaj authored May 15, 2024
2 parents 8dc4618 + d4eb422 commit 19cff1e
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions flow/connectors/postgres/qvalue_convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,19 @@ func parseFieldFromQValueKind(qvalueKind qvalue.QValueKind, value interface{}) (

switch qvalueKind {
case qvalue.QValueKindTimestamp:
timestamp := value.(time.Time)
return qvalue.QValueTimestamp{Val: timestamp}, nil
switch val := value.(type) {
case time.Time:
return qvalue.QValueTimestamp{Val: val}, nil
case pgtype.InfinityModifier:
return qvalue.QValueNull(qvalueKind), nil
}
case qvalue.QValueKindTimestampTZ:
timestamp := value.(time.Time)
return qvalue.QValueTimestampTZ{Val: timestamp}, nil
switch val := value.(type) {
case time.Time:
return qvalue.QValueTimestampTZ{Val: val}, nil
case pgtype.InfinityModifier:
return qvalue.QValueNull(qvalueKind), nil
}
case qvalue.QValueKindInterval:
intervalObject := value.(pgtype.Interval)
var interval datatypes.PeerDBInterval
Expand All @@ -274,8 +282,12 @@ func parseFieldFromQValueKind(qvalueKind qvalue.QValueKind, value interface{}) (

return qvalue.QValueString{Val: string(intervalJSON)}, nil
case qvalue.QValueKindDate:
date := value.(time.Time)
return qvalue.QValueDate{Val: date}, nil
switch val := value.(type) {
case time.Time:
return qvalue.QValueDate{Val: val}, nil
case pgtype.InfinityModifier:
return qvalue.QValueNull(qvalueKind), nil
}
case qvalue.QValueKindTime:
timeVal := value.(pgtype.Time)
if timeVal.Valid {
Expand Down

0 comments on commit 19cff1e

Please sign in to comment.