diff --git a/clients/snowflake/snowflake.go b/clients/snowflake/snowflake.go index 64de266e0..642f8c5a2 100644 --- a/clients/snowflake/snowflake.go +++ b/clients/snowflake/snowflake.go @@ -130,12 +130,12 @@ func (s *Store) reestablishConnection() error { func (s *Store) generateDedupeQueries(tableID, stagingTableID types.TableIdentifier, primaryKeys []string, topicConfig kafkalib.TopicConfig) []string { var primaryKeysEscaped []string for _, pk := range primaryKeys { - primaryKeysEscaped = append(primaryKeysEscaped, sql.EscapeNameIfNecessaryUsingDialect(pk, s.Dialect())) + primaryKeysEscaped = append(primaryKeysEscaped, sql.EscapeNameIfNecessary(pk, s.Dialect())) } orderColsToIterate := primaryKeysEscaped if topicConfig.IncludeArtieUpdatedAt { - orderColsToIterate = append(orderColsToIterate, sql.EscapeNameIfNecessaryUsingDialect(constants.UpdateColumnMarker, s.Dialect())) + orderColsToIterate = append(orderColsToIterate, sql.EscapeNameIfNecessary(constants.UpdateColumnMarker, s.Dialect())) } var orderByCols []string diff --git a/lib/destination/dml/merge.go b/lib/destination/dml/merge.go index c17fde831..62e564f25 100644 --- a/lib/destination/dml/merge.go +++ b/lib/destination/dml/merge.go @@ -129,7 +129,7 @@ func (m *MergeArgument) GetParts() ([]string, error) { // We also need to remove __artie flags since it does not exist in the destination table var removed bool for idx, col := range cols { - if col == sql.EscapeNameIfNecessaryUsingDialect(constants.DeleteColumnMarker, m.Dialect) { + if col == sql.EscapeNameIfNecessary(constants.DeleteColumnMarker, m.Dialect) { cols = append(cols[:idx], cols[idx+1:]...) removed = true break @@ -252,7 +252,7 @@ WHEN NOT MATCHED AND IFNULL(cc.%s, false) = false THEN INSERT (%s) VALUES (%s);` // We also need to remove __artie flags since it does not exist in the destination table var removed bool for idx, col := range cols { - if col == sql.EscapeNameIfNecessaryUsingDialect(constants.DeleteColumnMarker, m.Dialect) { + if col == sql.EscapeNameIfNecessary(constants.DeleteColumnMarker, m.Dialect) { cols = append(cols[:idx], cols[idx+1:]...) removed = true break @@ -322,7 +322,7 @@ WHEN NOT MATCHED AND COALESCE(cc.%s, 0) = 0 THEN INSERT (%s) VALUES (%s);`, // We also need to remove __artie flags since it does not exist in the destination table var removed bool for idx, col := range cols { - if col == sql.EscapeNameIfNecessaryUsingDialect(constants.DeleteColumnMarker, m.Dialect) { + if col == sql.EscapeNameIfNecessary(constants.DeleteColumnMarker, m.Dialect) { cols = append(cols[:idx], cols[idx+1:]...) removed = true break diff --git a/lib/sql/escape.go b/lib/sql/escape.go index 60e330f41..c1f34bda7 100644 --- a/lib/sql/escape.go +++ b/lib/sql/escape.go @@ -1,6 +1,6 @@ package sql -func EscapeNameIfNecessaryUsingDialect(name string, dialect Dialect) string { +func EscapeNameIfNecessary(name string, dialect Dialect) string { if dialect.NeedsEscaping(name) { return dialect.QuoteIdentifier(name) } diff --git a/lib/typing/columns/columns.go b/lib/typing/columns/columns.go index 78fad212f..386d74ea8 100644 --- a/lib/typing/columns/columns.go +++ b/lib/typing/columns/columns.go @@ -87,7 +87,7 @@ func (c *Column) RawName() string { // Plus we will escape it if the column name is part of the reserved words from destinations. // If so, it'll change from `start` => `"start"` as suggested by Snowflake. func (c *Column) Name(dialect sql.Dialect) string { - return sql.EscapeNameIfNecessaryUsingDialect(c.name, dialect) + return sql.EscapeNameIfNecessary(c.name, dialect) } type Columns struct {