Skip to content

Commit

Permalink
Merge pull request #83 from AkiraTamai/numeric-support-v1
Browse files Browse the repository at this point in the history
Support NUMERIC type
  • Loading branch information
kazegusuri authored Dec 20, 2021
2 parents c69509a + 26ce9c4 commit 74a022c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions loaders/spanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,14 @@ func SpanParseType(dt string, nullable bool) (int, string, string) {
nilVal = `spanner.NullJSON{}`
}

case "NUMERIC":
nilVal = "big.Rat{}"
typ = "big.Rat"
if nullable {
nilVal = "spanner.NullNumeric{}"
typ = "spanner.NullNumeric"
}

default:
if strings.HasPrefix(dt, "ARRAY<") {
eleDataType := strings.TrimSuffix(strings.TrimPrefix(dt, "ARRAY<"), ">")
Expand Down

0 comments on commit 74a022c

Please sign in to comment.