Skip to content

Commit

Permalink
added SQLQuoteReserved env variable for backward compatibiltiy
Browse files Browse the repository at this point in the history
  • Loading branch information
awitas committed Feb 16, 2023
1 parent 4bddbb0 commit 9279ced
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion reserved.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package dsc

import "strings"
import (
"os"
"strings"
)

var reservedKeyword = map[string]bool{
"key": true,
Expand Down Expand Up @@ -29,6 +32,9 @@ var reservedKeyword = map[string]bool{
}

func updateReserved(pk []string) {
if os.Getenv("SQLQuoteReserved") == "" {
return
}
for i := range pk {
if reservedKeyword[strings.ToLower(pk[i])] {
if strings.Count(pk[i], "`") == 0 {
Expand Down

0 comments on commit 9279ced

Please sign in to comment.