Skip to content

Commit

Permalink
Merge pull request #1564 from ydb-platform/driver-value
Browse files Browse the repository at this point in the history
* Fixed string representation of `TzTimestamp`, `TzDatetime` and `TzDate` type values + Added `database/sql/driver.Value` as type destination for almost ydb values
  • Loading branch information
asmyasnikov authored Nov 19, 2024
2 parents 81b83d4 + 6bd56e0 commit bc7672f
Show file tree
Hide file tree
Showing 13 changed files with 571 additions and 127 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* Fixed string representation of `TzTimestamp`, `TzDatetime` and `TzDate` type values
* Added `database/sql/driver.Value` as type destination for almost ydb values

## v3.92.5
* Avoid retrying requests finished with 'UNAUTHORIZED' errors

Expand Down
6 changes: 3 additions & 3 deletions internal/params/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ func TestBuilder(t *testing.T) {
},
Value: &Ydb.Value{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29T21:33:09Z",
TextValue: "1973-11-29T21:33:09,UTC",
},
},
},
Expand All @@ -370,7 +370,7 @@ func TestBuilder(t *testing.T) {
},
Value: &Ydb.Value{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29",
TextValue: "1973-11-29,UTC",
},
},
},
Expand All @@ -385,7 +385,7 @@ func TestBuilder(t *testing.T) {
},
Value: &Ydb.Value{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29T21:33:09.000000Z",
TextValue: "1973-11-29T21:33:09.000000,UTC",
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions internal/params/dict_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ func TestDict(t *testing.T) {
},
Value: &Ydb.Value{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29T21:33:09Z",
TextValue: "1973-11-29T21:33:09,UTC",
},
},
},
Expand All @@ -404,7 +404,7 @@ func TestDict(t *testing.T) {
},
Value: &Ydb.Value{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29",
TextValue: "1973-11-29,UTC",
},
},
},
Expand All @@ -419,7 +419,7 @@ func TestDict(t *testing.T) {
},
Value: &Ydb.Value{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29T21:33:09.000000Z",
TextValue: "1973-11-29T21:33:09.000000,UTC",
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions internal/params/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ func TestList(t *testing.T) {
},
Value: &Ydb.Value{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29T21:33:09Z",
TextValue: "1973-11-29T21:33:09,UTC",
},
},
},
Expand All @@ -403,7 +403,7 @@ func TestList(t *testing.T) {
},
Value: &Ydb.Value{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29",
TextValue: "1973-11-29,UTC",
},
},
},
Expand All @@ -418,7 +418,7 @@ func TestList(t *testing.T) {
},
Value: &Ydb.Value{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29T21:33:09.000000Z",
TextValue: "1973-11-29T21:33:09.000000,UTC",
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions internal/params/optional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ func TestOptional(t *testing.T) {
},
Value: &Ydb.Value{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29T21:33:09Z",
TextValue: "1973-11-29T21:33:09,UTC",
},
},
},
Expand All @@ -403,7 +403,7 @@ func TestOptional(t *testing.T) {
},
Value: &Ydb.Value{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29",
TextValue: "1973-11-29,UTC",
},
},
},
Expand All @@ -418,7 +418,7 @@ func TestOptional(t *testing.T) {
},
Value: &Ydb.Value{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29T21:33:09.000000Z",
TextValue: "1973-11-29T21:33:09.000000,UTC",
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions internal/params/set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ func TestSet(t *testing.T) {
},
Value: &Ydb.Value{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29T21:33:09Z",
TextValue: "1973-11-29T21:33:09,UTC",
},
},
},
Expand All @@ -403,7 +403,7 @@ func TestSet(t *testing.T) {
},
Value: &Ydb.Value{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29",
TextValue: "1973-11-29,UTC",
},
},
},
Expand All @@ -418,7 +418,7 @@ func TestSet(t *testing.T) {
},
Value: &Ydb.Value{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29T21:33:09.000000Z",
TextValue: "1973-11-29T21:33:09.000000,UTC",
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions internal/params/struct_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ func TestStruct(t *testing.T) {
Items: []*Ydb.Value{
{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29T21:33:09Z",
TextValue: "1973-11-29T21:33:09,UTC",
},
},
},
Expand Down Expand Up @@ -906,7 +906,7 @@ func TestStruct(t *testing.T) {
Items: []*Ydb.Value{
{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29",
TextValue: "1973-11-29,UTC",
},
},
},
Expand Down Expand Up @@ -939,7 +939,7 @@ func TestStruct(t *testing.T) {
Items: []*Ydb.Value{
{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29T21:33:09.000000Z",
TextValue: "1973-11-29T21:33:09.000000,UTC",
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions internal/params/tuple_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ func TestTuple(t *testing.T) {
},
Value: &Ydb.Value{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29T21:33:09Z",
TextValue: "1973-11-29T21:33:09,UTC",
},
},
},
Expand All @@ -403,7 +403,7 @@ func TestTuple(t *testing.T) {
},
Value: &Ydb.Value{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29",
TextValue: "1973-11-29,UTC",
},
},
},
Expand All @@ -418,7 +418,7 @@ func TestTuple(t *testing.T) {
},
Value: &Ydb.Value{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29T21:33:09.000000Z",
TextValue: "1973-11-29T21:33:09.000000,UTC",
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions internal/params/variant_struct_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ func TestVariantStruct(t *testing.T) {
},
Value: &Ydb.Value{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29T21:33:09Z",
TextValue: "1973-11-29T21:33:09,UTC",
},
VariantIndex: 0,
},
Expand All @@ -430,7 +430,7 @@ func TestVariantStruct(t *testing.T) {
},
Value: &Ydb.Value{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29",
TextValue: "1973-11-29,UTC",
},
VariantIndex: 0,
},
Expand All @@ -446,7 +446,7 @@ func TestVariantStruct(t *testing.T) {
},
Value: &Ydb.Value{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29T21:33:09.000000Z",
TextValue: "1973-11-29T21:33:09.000000,UTC",
},
VariantIndex: 0,
},
Expand Down
6 changes: 3 additions & 3 deletions internal/params/variant_tuple_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ func TestVariantTuple(t *testing.T) {
},
Value: &Ydb.Value{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29T21:33:09Z",
TextValue: "1973-11-29T21:33:09,UTC",
},
VariantIndex: 0,
},
Expand All @@ -429,7 +429,7 @@ func TestVariantTuple(t *testing.T) {
},
Value: &Ydb.Value{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29",
TextValue: "1973-11-29,UTC",
},
VariantIndex: 0,
},
Expand All @@ -445,7 +445,7 @@ func TestVariantTuple(t *testing.T) {
},
Value: &Ydb.Value{
Value: &Ydb.Value_TextValue{
TextValue: "1973-11-29T21:33:09.000000Z",
TextValue: "1973-11-29T21:33:09.000000,UTC",
},
VariantIndex: 0,
},
Expand Down
Loading

0 comments on commit bc7672f

Please sign in to comment.