diff --git a/.goreleaser.yaml b/.goreleaser.yaml index a4203b07e..346d0c98d 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,6 +1,7 @@ project_name: artie-transfer -# .goreleaser.yaml +version: 2 + before: hooks: # You may remove this if you don't use go modules. @@ -66,8 +67,3 @@ changelog: exclude: - '^docs:' - '^test:' - -# The lines beneath this are called `modelines`. See `:help modeline` -# Feel free to remove those if you don't want/use them. -# yaml-language-server: $schema=https://goreleaser.com/static/schema.json -# vim: set ts=2 sw=2 tw=0 fo=cnqoj diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index c1f03a666..000000000 --- a/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM --platform=linux/amd64 golang:1.22-alpine AS builder - -WORKDIR /app - -RUN apk -U add ca-certificates -RUN apk update && apk upgrade && apk add pkgconf git bash build-base sudo - -COPY . . - -RUN go build -o transfer . - -FROM --platform=linux/amd64 alpine:3.19 AS runner - -COPY --from=builder /app/transfer / diff --git a/clients/bigquery/storagewrite.go b/clients/bigquery/storagewrite.go index af27f1236..ffba7df79 100644 --- a/clients/bigquery/storagewrite.go +++ b/clients/bigquery/storagewrite.go @@ -21,7 +21,7 @@ import ( "google.golang.org/protobuf/types/known/timestamppb" ) -// columnToTableFieldSchema returns a [*storagepb.TableFieldSchema] suitable for transfering data of the type that the column specifies. +// columnToTableFieldSchema returns a [*storagepb.TableFieldSchema] suitable for transferring data of the type that the column specifies. // Not that the data type is not necessarily the data type that the table in the database is using. func columnToTableFieldSchema(column columns.Column) (*storagepb.TableFieldSchema, error) { var fieldType storagepb.TableFieldSchema_Type @@ -150,7 +150,7 @@ func rowToMessage(row map[string]any, columns []columns.Column, messageDescripto } message.Set(field, protoreflect.ValueOfFloat64(floatValue)) default: - return nil, fmt.Errorf("expected float32/float64/int32/int64/string recieved %T with value %v", value, value) + return nil, fmt.Errorf("expected float32/float64/int32/int64/string received %T with value %v", value, value) } case typing.EDecimal.Kind: if decimalValue, ok := value.(*decimal.Decimal); ok { diff --git a/clients/mssql/dialect/dialect.go b/clients/mssql/dialect/dialect.go index a34787bee..5f71bbdb9 100644 --- a/clients/mssql/dialect/dialect.go +++ b/clients/mssql/dialect/dialect.go @@ -149,7 +149,7 @@ func (MSSQLDialect) IsTableDoesNotExistErr(err error) bool { } func (MSSQLDialect) BuildCreateTableQuery(tableID sql.TableIdentifier, _ bool, colSQLParts []string) string { - // Microsoft SQL Server uses the same syntax for temporary and permanant tables. + // Microsoft SQL Server uses the same syntax for temporary and permanent tables. // Microsoft SQL Server doesn't support IF NOT EXISTS return fmt.Sprintf("CREATE TABLE %s (%s);", tableID.FullyQualifiedName(), strings.Join(colSQLParts, ",")) } diff --git a/clients/redshift/dialect/dialect.go b/clients/redshift/dialect/dialect.go index afc9c4497..54fa591c4 100644 --- a/clients/redshift/dialect/dialect.go +++ b/clients/redshift/dialect/dialect.go @@ -115,7 +115,7 @@ func (RedshiftDialect) IsTableDoesNotExistErr(err error) bool { } func (RedshiftDialect) BuildCreateTableQuery(tableID sql.TableIdentifier, _ bool, colSQLParts []string) string { - // Redshift uses the same syntax for temporary and permanant tables. + // Redshift uses the same syntax for temporary and permanent tables. return fmt.Sprintf("CREATE TABLE IF NOT EXISTS %s (%s);", tableID.FullyQualifiedName(), strings.Join(colSQLParts, ",")) } diff --git a/goreleaser.dockerfile b/goreleaser.dockerfile index e1011c0e9..1780f627e 100644 --- a/goreleaser.dockerfile +++ b/goreleaser.dockerfile @@ -1,2 +1,2 @@ -FROM --platform=linux/amd64 alpine:3.16 +FROM --platform=linux/amd64 alpine:3.20 COPY transfer /transfer diff --git a/lib/config/constants/constants.go b/lib/config/constants/constants.go index 835e22857..b626a0458 100644 --- a/lib/config/constants/constants.go +++ b/lib/config/constants/constants.go @@ -8,7 +8,7 @@ const ( ToastUnavailableValuePlaceholder = "__debezium_unavailable_value" // DebeziumTopicRoutingKey - https://debezium.io/documentation/reference/stable/transformations/topic-routing.html#by-logical-table-router-key-field-name - // This key is added to ensure no compaction or mutation happens since multiple tables are now going into the same topic and may have overlaping key ids. + // This key is added to ensure no compaction or mutation happens since multiple tables are now going into the same topic and may have overlapping key ids. // We will strip this out from our partition key parsing. DebeziumTopicRoutingKey = "__dbz__physicalTableIdentifier" diff --git a/lib/typing/decimal/details.go b/lib/typing/decimal/details.go index dd348c9b6..f48ee485b 100644 --- a/lib/typing/decimal/details.go +++ b/lib/typing/decimal/details.go @@ -2,6 +2,7 @@ package decimal import ( "fmt" + "log/slog" ) const ( @@ -17,6 +18,13 @@ type Details struct { } func NewDetails(precision int32, scale int32) Details { + if precision == 0 { + // MySQL, PostgreSQL, and SQLServer do not allow a zero precision, so this should never happen. + // Let's log if we observe it happening, and if we don't see it in the logs then we can use zero as the + // [PrecisionNotSpecified] value and change precision to a uint16. + slog.Error("Decimal precision is zero") + } + if scale > precision && precision != PrecisionNotSpecified { // Note: -1 precision means it's not specified.