hasMixedCase returns true if the string has any uppercase letters (identifiers with mixed case need quoting in PostgreSQL)
(s string)
| 8 | // hasMixedCase returns true if the string has any uppercase letters |
| 9 | // (identifiers with mixed case need quoting in PostgreSQL) |
| 10 | func hasMixedCase(s string) bool { |
| 11 | for _, r := range s { |
| 12 | if r >= 'A' && r <= 'Z' { |
| 13 | return true |
| 14 | } |
| 15 | } |
| 16 | return false |
| 17 | } |
| 18 | |
| 19 | // QuoteIdent returns a quoted identifier if it needs quoting. |
| 20 | // This implements the format.Dialect interface. |