formatSummaryInsert pretty-prints a summarized insert/upsert statement. See FmtSummary for supported formats.
(node *Insert)
| 735 | // formatSummaryInsert pretty-prints a summarized insert/upsert statement. |
| 736 | // See FmtSummary for supported formats. |
| 737 | func (ctx *FmtCtx) formatSummaryInsert(node *Insert) { |
| 738 | if node.OnConflict.IsUpsertAlias() { |
| 739 | ctx.WriteString("UPSERT") |
| 740 | } else { |
| 741 | ctx.WriteString("INSERT") |
| 742 | } |
| 743 | ctx.WriteString(" INTO ") |
| 744 | ctx.formatLimitLength(node.Table, TableLimit) |
| 745 | rows := node.Rows |
| 746 | expr := rows.Select |
| 747 | if _, ok := expr.(*SelectClause); ok { |
| 748 | ctx.WriteByte(' ') |
| 749 | ctx.formatNodeSummary(rows) |
| 750 | } else if node.Columns != nil { |
| 751 | ctx.WriteByte('(') |
| 752 | ctx.formatLimitLength(&node.Columns, ColumnLimit) |
| 753 | ctx.WriteByte(')') |
| 754 | } |
| 755 | } |
| 756 | |
| 757 | // formatSummaryUpdate pretty-prints a summarized update statement. |
| 758 | // See FmtSummary for supported formats. |
no test coverage detected