SanitizeSQL replaces placeholder values with args. It quotes and escapes args as necessary. This function is only safe when standard_conforming_strings is on.
(sql string, args ...any)
| 512 | // as necessary. This function is only safe when standard_conforming_strings is |
| 513 | // on. |
| 514 | func SanitizeSQL(sql string, args ...any) (string, error) { |
| 515 | query := queryPool.get() |
| 516 | query.init(sql) |
| 517 | defer queryPool.put(query) |
| 518 | |
| 519 | return query.Sanitize(args...) |
| 520 | } |
| 521 | |
| 522 | type pool[E any] struct { |
| 523 | p sync.Pool |