From d11fc397f1b9801de795ebe4c950de5ed75aa897 Mon Sep 17 00:00:00 2001 From: Efstathios Chouliaris Date: Thu, 19 Sep 2024 15:50:12 -0500 Subject: [PATCH] try to recreate the issue with UUID to solve #1209 --- converter_test.go | 16 ++++++++++++---- go.mod | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/converter_test.go b/converter_test.go index 375359465..5b52f48d6 100644 --- a/converter_test.go +++ b/converter_test.go @@ -282,6 +282,14 @@ func TestValueToString(t *testing.T) { assertEqualE(t, *bv.value, "[1,2]") }) + t.Run("UUID - should return string", func(t *testing.T) { + u := uuid.New() + bv, err := valueToString(u, textType, nil) + assertNilF(t, err) + assertEmptyStringE(t, bv.format) + assertEqualE(t, *bv.value, u.String()) + }) + bv, err = valueToString(&testValueToStringStructuredObject{s: "some string", i: 123, date: time.Date(2024, time.May, 24, 0, 0, 0, 0, time.UTC)}, timestampLtzType, params) assertNilF(t, err) assertEqualE(t, bv.format, "json") @@ -2175,7 +2183,7 @@ func TestSmallTimestampBinding(t *testing.T) { rows := sct.mustQueryContext(ctx, "SELECT ?", parameters) defer func() { - assertNilF(t, rows.Close()) + assertNilF(t, rows.Close()) }() scanValues := make([]driver.Value, 1) @@ -2213,7 +2221,7 @@ func TestTimestampConversionWithoutArrowBatches(t *testing.T) { query := fmt.Sprintf("SELECT '%s'::%s(%v)", tsStr, tp, scale) rows := sct.mustQueryContext(ctx, query, nil) defer func() { - assertNilF(t, rows.Close()) + assertNilF(t, rows.Close()) }() if rows.Next() { @@ -2295,7 +2303,7 @@ func TestTimestampConversionWithArrowBatchesMicrosecondPassesForDistantDates(t * t.Fatalf("failed to query: %v", err) } defer func() { - assertNilF(t, rows.Close()) + assertNilF(t, rows.Close()) }() // getting result batches @@ -2356,7 +2364,7 @@ func TestTimestampConversionWithArrowBatchesAndWithOriginalTimestamp(t *testing. query := fmt.Sprintf("SELECT '%s'::%s(%v)", tsStr, tp, scale) rows := sct.mustQueryContext(ctx, query, []driver.NamedValue{}) defer func() { - assertNilF(t, rows.Close()) + assertNilF(t, rows.Close()) }() // getting result batches diff --git a/go.mod b/go.mod index b4c1fca13..fdaf087cb 100644 --- a/go.mod +++ b/go.mod @@ -15,6 +15,7 @@ require ( github.com/aws/smithy-go v1.20.2 github.com/gabriel-vasile/mimetype v1.4.2 github.com/golang-jwt/jwt/v5 v5.2.1 + github.com/google/uuid v1.3.1 github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 github.com/sirupsen/logrus v1.9.3 golang.org/x/crypto v0.22.0