Skip to content

Commit

Permalink
WIP.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Oct 17, 2024
1 parent a2eadd2 commit 0adb8c1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions lib/debezium/converters/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ func (JSON) ToKindDetails() typing.KindDetails {

type Int64Passthrough struct{}

func (Int64Passthrough) ToKindDetails() typing.KindDetails {
return typing.Integer
func (Int64Passthrough) ToKindDetails() (typing.KindDetails, error) {
return typing.Integer, nil
}

func (Int64Passthrough) Convert(value any) (any, error) {
Expand All @@ -44,9 +44,9 @@ func (Int64Passthrough) Convert(value any) (any, error) {

type Base64 struct{}

func (Base64) ToKindDetails() typing.KindDetails {
func (Base64) ToKindDetails() (typing.KindDetails, error) {
// We're returning this back as a base64 encoded string.
return typing.String
return typing.String, nil
}

func (Base64) Convert(value any) (any, error) {
Expand Down
4 changes: 2 additions & 2 deletions lib/debezium/converters/geometry.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const Point GeometricShapes = "Point"

type GeometryPoint struct{}

func (GeometryPoint) ToKindDetails() typing.KindDetails {
return typing.Struct
func (GeometryPoint) ToKindDetails() (typing.KindDetails, error) {
return typing.Struct, nil
}

// Convert takes in a map[string]any and returns a GeoJSON string. This function does not use WKB or SRID and leverages X, Y.
Expand Down
4 changes: 2 additions & 2 deletions lib/debezium/converters/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ func (StringPassthrough) Convert(value any) (any, error) {
return castedValue, nil
}

func (StringPassthrough) ToKindDetails() typing.KindDetails {
return typing.String
func (StringPassthrough) ToKindDetails() (typing.KindDetails, error) {
return typing.String, nil
}
4 changes: 2 additions & 2 deletions lib/debezium/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (f Field) GetScaleAndPrecision() (int32, *int32, error) {
return 0, nil, precisionErr
}

precisionPtr = typing.ToPtr(int32(precision))
precisionPtr = typing.ToPtr(precision)
}

return scale, precisionPtr, nil
Expand Down Expand Up @@ -148,7 +148,7 @@ func (f Field) ToKindDetails() (typing.KindDetails, error) {
}

if converter != nil {
return converter.ToKindDetails(), nil
return converter.ToKindDetails()
}

switch f.Type {
Expand Down

0 comments on commit 0adb8c1

Please sign in to comment.