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)
| 68 | // contains special characters, or the identifier is a reserved SQL |
| 69 | // keyword. |
| 70 | func EncodeRestrictedSQLIdent(buf *bytes.Buffer, s string, flags EncodeFlags) { |
| 71 | if !flags.HasFlags(EncAlwaysQuoted) && (flags.HasFlags(EncBareIdentifiers) || (!isReservedKeyword(s) && IsBareIdentifier(s))) { |
| 72 | buf.WriteString(s) |
| 73 | return |
| 74 | } |
| 75 | EncodeEscapedSQLIdent(buf, s) |
| 76 | } |
| 77 | |
| 78 | // EncodeUnrestrictedSQLIdent writes the identifier in s to buf. |
| 79 | // The identifier is only quoted if the flags don't tell otherwise and |
no test coverage detected
searching dependent graphs…