From fa90737a2adbe0cefbaba4aa1046a6efbba2a0e9 Mon Sep 17 00:00:00 2001 From: apstndb Date: Thu, 10 Dec 2020 20:57:04 +0900 Subject: [PATCH] feat(spanner): support NUMERIC in mutations (#3328) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Knut Olav Løite Co-authored-by: skuruppu --- spanner/mutation.go | 2 ++ spanner/value.go | 1 + 2 files changed, 3 insertions(+) diff --git a/spanner/mutation.go b/spanner/mutation.go index 0d64d9b04d9..a0d1466b6ac 100644 --- a/spanner/mutation.go +++ b/spanner/mutation.go @@ -119,6 +119,8 @@ const ( // []time.Time, []*time.Time, []NullTime - TIMESTAMP ARRAY // Date, *Date, NullDate - DATE // []Date, []*Date, []NullDate - DATE ARRAY +// big.Rat, *big.Rat, NullNumeric - NUMERIC +// []big.Rat, []*big.Rat, []NullNumeric - NUMERIC ARRAY // // To compare two Mutations for testing purposes, use reflect.DeepEqual. type Mutation struct { diff --git a/spanner/value.go b/spanner/value.go index 8ed147e36de..eb2a873a715 100644 --- a/spanner/value.go +++ b/spanner/value.go @@ -3067,6 +3067,7 @@ func isSupportedMutationType(v interface{}) bool { float64, *float64, []float64, []*float64, NullFloat64, []NullFloat64, time.Time, *time.Time, []time.Time, []*time.Time, NullTime, []NullTime, civil.Date, *civil.Date, []civil.Date, []*civil.Date, NullDate, []NullDate, + big.Rat, *big.Rat, []big.Rat, []*big.Rat, NullNumeric, []NullNumeric, GenericColumnValue: return true default: