Skip to content

Commit

Permalink
[Debezium] Supporting more types (#872)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 authored Sep 4, 2024
1 parent 836af1e commit a89be8f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/debezium/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (f Field) GetScaleAndPrecision() (int32, *int32, error) {

func (f Field) ToValueConverter() converters.ValueConverter {
switch f.DebeziumType {
case UUID:
case UUID, Enum:
return converters.StringPassthrough{}
case DateTimeWithTimezone:
return converters.DateTimeWithTimezone{}
Expand Down
11 changes: 9 additions & 2 deletions lib/debezium/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,15 @@ func TestField_ToKindDetails(t *testing.T) {
assert.Equal(t, typing.String, Field{Type: Bytes}.ToKindDetails())
}
{
// UUID
assert.Equal(t, typing.String, Field{DebeziumType: UUID, Type: String}.ToKindDetails())
// String passthrough
{
// UUID
assert.Equal(t, typing.String, Field{DebeziumType: UUID, Type: String}.ToKindDetails())
}
{
// Enum
assert.Equal(t, typing.String, Field{DebeziumType: Enum, Type: String}.ToKindDetails())
}
}
{
// Structs
Expand Down

0 comments on commit a89be8f

Please sign in to comment.