Skip to content

Commit

Permalink
[redshift] Log uppercased escaped names
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-artie committed Apr 23, 2024
1 parent 2108647 commit 025cb41
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/sql/escape.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package sql

import (
"fmt"
"log/slog"
"slices"
"strconv"
"strings"
Expand Down Expand Up @@ -50,6 +51,13 @@ func NeedsEscaping(name string, destKind constants.DestinationKind) bool {

func EscapeName(name string, uppercaseEscNames bool, destKind constants.DestinationKind) string {
if uppercaseEscNames {
if destKind == constants.Redshift {
slog.Warn("Escaped Redshift identifier is being uppercased",
slog.String("name", name),
slog.Bool("uppercaseEscapedNames", uppercaseEscNames),
)
}

name = strings.ToUpper(name)
}

Expand Down

0 comments on commit 025cb41

Please sign in to comment.