EncodeRestrictedSQLIdent writes the identifier in s to buf. The identifier is quoted if either the flags ask for it, the identifier contains special characters, or the identifier is a reserved SQL keyword.
(buf *bytes.Buffer, s string, flags EncodeFlags)
| 163 | // contains special characters, or the identifier is a reserved SQL |
| 164 | // keyword. |
| 165 | func EncodeRestrictedSQLIdent(buf *bytes.Buffer, s string, flags EncodeFlags) { |
| 166 | if flags.HasFlags(EncBareIdentifiers) || (!isReservedKeyword(s) && isBareIdentifier(s)) { |
| 167 | buf.WriteString(s) |
| 168 | return |
| 169 | } |
| 170 | EncodeEscapedSQLIdent(buf, s) |
| 171 | } |
| 172 | |
| 173 | // EncodeEscapedSQLIdent writes the identifier in s to buf. The |
| 174 | // identifier is always quoted. Double quotes inside the identifier |
no test coverage detected