Add quote dialects
This commit is contained in:
parent
817189fbfd
commit
9e6a3d5ee3
9 changed files with 109 additions and 9 deletions
strmangle
|
@ -46,6 +46,18 @@ func SchemaTable(driver string, schema string, table string) string {
|
|||
return fmt.Sprintf(`"%s"`, table)
|
||||
}
|
||||
|
||||
// WrapQuote wraps a quote character in quotes.
|
||||
func WrapQuote(s string) string {
|
||||
if s == `"` {
|
||||
return "`\"`"
|
||||
}
|
||||
if s == "`" {
|
||||
return "\"`\""
|
||||
}
|
||||
|
||||
return fmt.Sprintf("`%s`", s)
|
||||
}
|
||||
|
||||
// IdentQuote attempts to quote simple identifiers in SQL tatements
|
||||
func IdentQuote(s string) string {
|
||||
if strings.ToLower(s) == "null" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue