Skip to content

Commit

Permalink
[sql] Kill EscapeName function
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-artie committed May 1, 2024
1 parent f076a18 commit fa13251
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
3 changes: 1 addition & 2 deletions clients/snowflake/writes.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/artie-labs/transfer/lib/destination/types"
"github.com/artie-labs/transfer/lib/logger"
"github.com/artie-labs/transfer/lib/optimization"
"github.com/artie-labs/transfer/lib/sql"
)

func (s *Store) Append(tableData *optimization.TableData) error {
Expand Down Expand Up @@ -55,7 +54,7 @@ func (s *Store) Merge(tableData *optimization.TableData) error {
var additionalEqualityStrings []string
if len(tableData.TopicConfig().AdditionalMergePredicates) > 0 {
for _, additionalMergePredicate := range tableData.TopicConfig().AdditionalMergePredicates {
mergePredicateCol := sql.EscapeName(additionalMergePredicate.PartitionField, s.ShouldUppercaseEscapedNames(), s.Label())
mergePredicateCol := s.Dialect().QuoteIdentifier(additionalMergePredicate.PartitionField)
additionalEqualityStrings = append(additionalEqualityStrings, fmt.Sprintf("c.%s = cc.%s", mergePredicateCol, mergePredicateCol))
}
}
Expand Down
5 changes: 0 additions & 5 deletions lib/sql/escape.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,3 @@ func dialectFor(destKind constants.DestinationKind, uppercaseEscNames bool) Dial
return DefaultDialect{}
}
}

func EscapeName(name string, uppercaseEscNames bool, destKind constants.DestinationKind) string {
// TODO: This is only used in one place, remove once [Dialect] has beem added to [Store].
return dialectFor(destKind, uppercaseEscNames).QuoteIdentifier(name)
}

0 comments on commit fa13251

Please sign in to comment.