writeSuffixSelectClause writes the " WHERE ... ORDER BY ... LIMIT ..." suffix of a DML statement, sliced from the original SQL via the node's Loc.
(buf *strings.Builder, node ast.Node, fullSQL string)
| 706 | // writeSuffixSelectClause writes the "<table refs> WHERE ... ORDER BY ... LIMIT ..." |
| 707 | // suffix of a DML statement, sliced from the original SQL via the node's Loc. |
| 708 | func writeSuffixSelectClause(buf *strings.Builder, node ast.Node, fullSQL string) error { |
| 709 | switch n := node.(type) { |
| 710 | case *ast.UpdateStmt: |
| 711 | return writeUpdateSuffix(buf, n, fullSQL) |
| 712 | case *ast.DeleteStmt: |
| 713 | return writeDeleteSuffix(buf, n, fullSQL) |
| 714 | } |
| 715 | return nil |
| 716 | } |
| 717 | |
| 718 | func writeUpdateSuffix(buf *strings.Builder, n *ast.UpdateStmt, sql string) error { |
| 719 | // "table_refs": from the first table ref to the last table ref's end. |
no test coverage detected