Skip to content

Commit

Permalink
Remove ptrs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Sep 18, 2024
1 parent 70dc8cc commit 6570776
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
4 changes: 2 additions & 2 deletions lib/debezium/converters/money_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package converters

import (
"github.com/artie-labs/transfer/lib/typing"
"testing"

"github.com/artie-labs/reader/lib/ptr"
transferDbz "github.com/artie-labs/transfer/lib/debezium"
"github.com/artie-labs/transfer/lib/typing/decimal"
"github.com/stretchr/testify/assert"
Expand All @@ -18,7 +18,7 @@ func TestMoney_Scale(t *testing.T) {
{
// Specified
converter := MoneyConverter{
ScaleOverride: ptr.ToUint16(3),
ScaleOverride: typing.ToPtr(uint16(3)),
}
assert.Equal(t, uint16(3), converter.Scale())
}
Expand Down
4 changes: 2 additions & 2 deletions lib/mongo/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package mongo
import (
"encoding/json"
"fmt"
"github.com/artie-labs/transfer/lib/typing"
"time"

"github.com/artie-labs/transfer/lib/cdc/mongo"
Expand All @@ -12,7 +13,6 @@ import (

"github.com/artie-labs/reader/config"
"github.com/artie-labs/reader/lib"
"github.com/artie-labs/reader/lib/ptr"
)

type Message struct {
Expand Down Expand Up @@ -97,7 +97,7 @@ func ParseMessage(after bson.M, before *bson.M, op string) (*Message, error) {
return nil, fmt.Errorf("failed to marshal document to JSON extended: %w", err)
}

msg.beforeJSONExtendedString = ptr.ToPtr(string(beforeRow))
msg.beforeJSONExtendedString = typing.ToPtr(string(beforeRow))
}

return msg, nil
Expand Down
9 changes: 0 additions & 9 deletions lib/ptr/ptr.go

This file was deleted.

4 changes: 2 additions & 2 deletions sources/mssql/adapter/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package adapter
import (
"database/sql"
"fmt"
"github.com/artie-labs/transfer/lib/typing"

"github.com/artie-labs/reader/config"
"github.com/artie-labs/reader/lib/debezium/converters"
"github.com/artie-labs/reader/lib/debezium/transformer"
"github.com/artie-labs/reader/lib/mssql"
"github.com/artie-labs/reader/lib/mssql/schema"
ptr2 "github.com/artie-labs/reader/lib/ptr"
"github.com/artie-labs/reader/lib/rdbms/column"
"github.com/artie-labs/reader/lib/rdbms/scan"
)
Expand Down Expand Up @@ -94,7 +94,7 @@ func valueConverterForType(dataType schema.DataType, opts *schema.Opts) (convert
case schema.Money:
return converters.MoneyConverter{
// MSSQL uses scale of 4 for money
ScaleOverride: ptr2.ToUint16(4),
ScaleOverride: typing.ToPtr(uint16(4)),
}, nil
case schema.String, schema.UniqueIdentifier:
return converters.StringPassthrough{}, nil
Expand Down

0 comments on commit 6570776

Please sign in to comment.