Skip to content

Commit cb82c65

Browse files
authored
Added support for Timestamp64 type in value.Any converter (#1975)
1 parent 65ead76 commit cb82c65

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
* Added support for `Timestamp64` type in `value.Any` converter
12
* Masked the sensitive credential data in the connection string (DSN, data source name) from error messages for security reasons
23

34
## v3.121.0

internal/value/any.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ func Any(v Value) (any, error) { //nolint:funlen,gocyclo
5151
return uint64(vv), nil
5252
case timestampValue:
5353
return TimestampToTime(uint64(vv)), nil
54+
case timestamp64Value:
55+
return Timestamp64ToTime(int64(vv)), nil
5456
case int64Value:
5557
return int64(vv), nil
5658
case intervalValue:

internal/value/any_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ func TestAny(t *testing.T) {
109109
src: timestampValue(123),
110110
exp: time.Unix(0, int64(123*time.Microsecond)).Local(),
111111
},
112+
{
113+
src: timestamp64Value(123),
114+
exp: time.Unix(0, int64(123*time.Microsecond)).Local(),
115+
},
112116
{
113117
src: intervalValue(123),
114118
exp: 123 * time.Microsecond,

0 commit comments

Comments
 (0)