QuoteLiteral escapes v so it can be safely used as a literal (or constant) in an SQL statement.
(v string)
| 14 | // QuoteLiteral escapes v so it can be safely used as a literal (or constant) |
| 15 | // in an SQL statement. |
| 16 | func QuoteLiteral(v string) string { |
| 17 | // Use the "escape" syntax to ensure that backslashes behave consistently regardless |
| 18 | // of the "standard_conforming_strings" parameter. Include a space before so |
| 19 | // the "E" cannot change the meaning of an adjacent SQL keyword or identifier. |
| 20 | // - https://www.postgresql.org/docs/current/sql-syntax-lexical.html |
| 21 | return ` E'` + escapeLiteral(v) + `'` |
| 22 | } |
no outgoing calls