Skip to content

Commit d303d72

Browse files
authored
fix: oracle export number (#403)
* fix: oracle driver does not support json.Number * docs: update changelog * style: gocritic
1 parent 82cb06f commit d303d72

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Types of changes
1818

1919
- `Added` new push mode `upsert` to insert or update rows based on primary keys
2020
- `Fixed` relations extraction with Oracle database create duplicated relations
21+
- `Fixed` push column exported as numeric with Oracle database
2122

2223
## [3.5.0]
2324

internal/infra/push/datadestination_oracle.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package push
22

33
import (
4+
"encoding/json"
45
"fmt"
56
"strings"
67
"time"
@@ -251,6 +252,13 @@ func (d OracleDialect) ConvertValue(from push.Value, descriptor ValueDescriptor)
251252
return go_ora.Blob{Data: v, Valid: true}
252253
}
253254
}
255+
if descriptor.column != nil && descriptor.column.Export() == "numeric" {
256+
//nolint:gocritic
257+
switch v := from.(type) {
258+
case json.Number:
259+
return v.String()
260+
}
261+
}
254262
// FIXME: Workaround to parse time from json
255263
aTime, err := time.Parse("2006-01-02T15:04:05.999Z07:00", fmt.Sprintf("%v", from))
256264
if err != nil {

0 commit comments

Comments
 (0)