(name string)
| 3623 | } |
| 3624 | |
| 3625 | func (g *Generator) forceEscapeSQLName(name string) string { |
| 3626 | switch g.mode { |
| 3627 | case GeneratorModeMssql: |
| 3628 | escaped := strings.ReplaceAll(name, "]", "]]") |
| 3629 | return fmt.Sprintf("[%s]", escaped) |
| 3630 | case GeneratorModeMysql: |
| 3631 | escaped := strings.ReplaceAll(name, "`", "``") |
| 3632 | return fmt.Sprintf("`%s`", escaped) |
| 3633 | default: // standard SQL (PostgreSQL, SQLite) |
| 3634 | escaped := strings.ReplaceAll(name, "\"", "\"\"") |
| 3635 | return fmt.Sprintf("\"%s\"", escaped) |
| 3636 | } |
| 3637 | } |
| 3638 | |
| 3639 | // escapeSQLIdent escapes an Ident for SQL output, respecting the quote-aware normalization setting. |
| 3640 | // When legacy_ignore_quotes is false: |
no outgoing calls
no test coverage detected