()
| 7074 | } |
| 7075 | |
| 7076 | public override toStringTokens(): StepStringToken[] { |
| 7077 | const tokens: StepStringToken[] = [{ kind: "start" }, { kind: "name", value: this.name }]; |
| 7078 | |
| 7079 | if (this.config.distinct) { |
| 7080 | tokens.push({ kind: "keyword", value: "DISTINCT" }); |
| 7081 | } |
| 7082 | |
| 7083 | const itemsStr = this.config.items |
| 7084 | .map((item) => { |
| 7085 | if (item.type === "aggregate") { |
| 7086 | return `${item.function}(${item.sourceVariable}${item.property ? "." + item.property : ""}) AS ${item.alias}`; |
| 7087 | } else if (item.type === "property") { |
| 7088 | return `${item.sourceVariable}.${item.property} AS ${item.alias}`; |
| 7089 | } else if (item.type === "functionCall") { |
| 7090 | return `${item.functionName}(...) AS ${item.alias}`; |
| 7091 | } else if (item.type === "expression") { |
| 7092 | return `(expr) AS ${item.alias}`; |
| 7093 | } else { |
| 7094 | return item.sourceVariable === item.alias |
| 7095 | ? item.alias |
| 7096 | : `${item.sourceVariable} AS ${item.alias}`; |
| 7097 | } |
| 7098 | }) |
| 7099 | .join(", "); |
| 7100 | tokens.push({ kind: "value", value: itemsStr }); |
| 7101 | |
| 7102 | tokens.push({ kind: "end" }); |
| 7103 | return tokens; |
| 7104 | } |
| 7105 | } |
| 7106 | |
| 7107 | function resolveProjectedOrderValue( |
no test coverage detected