---- Query compilation ----
(ctx Context, qc *qcode.QCode)
| 174 | // ---- Query compilation ---- |
| 175 | |
| 176 | func (d *ClickHouseDialect) CompileFullQuery(ctx Context, qc *qcode.QCode) bool { |
| 177 | if len(qc.Roots) == 0 { |
| 178 | ctx.SetError(fmt.Errorf("clickhouse: empty query")) |
| 179 | return true |
| 180 | } |
| 181 | if len(qc.Roots) > 1 { |
| 182 | ctx.SetError(fmt.Errorf("clickhouse: only a single root selection is supported per query")) |
| 183 | return true |
| 184 | } |
| 185 | b := &chBuilder{prefix: ctx.GetSecPrefix()} |
| 186 | node, err := b.buildNode(qc, &qc.Selects[qc.Roots[0]]) |
| 187 | if err != nil { |
| 188 | ctx.SetError(err) |
| 189 | return true |
| 190 | } |
| 191 | b.emit(ctx, chDSL{Operation: "query", Root: node}) |
| 192 | return true |
| 193 | } |
| 194 | |
| 195 | func (b *chBuilder) buildNode(qc *qcode.QCode, sel *qcode.Select) (*chNode, error) { |
| 196 | n := &chNode{ |
nothing calls this directly
no test coverage detected