Skip to content

Commit

Permalink
fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-zhengda committed Sep 19, 2023
1 parent b98ebf7 commit 0e4386f
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions obfuscator.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,27 +99,25 @@ func (o *Obfuscator) ObfuscateTokenValue(token Token, lexerOpts ...lexerOption)
}
case STRING, INCOMPLETE_STRING, DOLLAR_QUOTED_STRING:
return StringPlaceholder
case POSITIONAL_PARAMETER:
if o.config.ReplacePositionalParameter {
obfuscatedSQL.WriteString(StringPlaceholder)
} else {
obfuscatedSQL.WriteString(token.Value)
}
case POSITIONAL_PARAMETER:
if o.config.ReplacePositionalParameter {
return StringPlaceholder
} else {
return token.Value
}
case IDENT:
if o.config.ReplaceBoolean && isBoolean(token.Value) {
obfuscatedSQL.WriteString(StringPlaceholder)
continue
}
if o.config.ReplaceNull && isNull(token.Value) {
obfuscatedSQL.WriteString(StringPlaceholder)
continue
}

if o.config.ReplaceDigits {
obfuscatedSQL.WriteString(replaceDigits(token.Value, "?"))
} else {
obfuscatedSQL.WriteString(token.Value)
}
return StringPlaceholder
}
if o.config.ReplaceNull && isNull(token.Value) {
return StringPlaceholder
}

if o.config.ReplaceDigits {
return replaceDigits(token.Value, "?")
} else {
return token.Value
}
default:
return token.Value
}
Expand Down

0 comments on commit 0e4386f

Please sign in to comment.