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)
| 150 | // contains special characters, or the identifier is a reserved SQL |
| 151 | // keyword. |
| 152 | func EncodeRestrictedSQLIdent(buf *bytes.Buffer, s string, flags EncodeFlags) { |
| 153 | if flags.HasFlags(EncBareIdentifiers) || (!isReservedKeyword(s) && isBareIdentifier(s)) { |
| 154 | buf.WriteString(s) |
| 155 | return |
| 156 | } |
| 157 | EncodeEscapedSQLIdent(buf, s) |
| 158 | } |
| 159 | |
| 160 | // EncodeEscapedSQLIdent writes the identifier in s to buf. The |
| 161 | // identifier is always quoted. Double quotes inside the identifier |
no test coverage detected
searching dependent graphs…