---- Query compilation ----
(ctx Context, qc *qcode.QCode)
| 149 | // ---- Query compilation ---- |
| 150 | |
| 151 | func (d *CassandraDialect) CompileFullQuery(ctx Context, qc *qcode.QCode) bool { |
| 152 | if len(qc.Roots) == 0 { |
| 153 | ctx.SetError(fmt.Errorf("cassandra: empty query")) |
| 154 | return true |
| 155 | } |
| 156 | if len(qc.Roots) > 1 { |
| 157 | ctx.SetError(fmt.Errorf("cassandra: only a single root selection is supported per query")) |
| 158 | return true |
| 159 | } |
| 160 | b := &casBuilder{} |
| 161 | node, err := b.buildNode(qc, &qc.Selects[qc.Roots[0]]) |
| 162 | if err != nil { |
| 163 | ctx.SetError(err) |
| 164 | return true |
| 165 | } |
| 166 | b.emit(ctx, casDSL{Operation: "query", Root: node}) |
| 167 | return true |
| 168 | } |
| 169 | |
| 170 | func (b *casBuilder) buildNode(qc *qcode.QCode, sel *qcode.Select) (*casNode, error) { |
| 171 | if sel.GroupCols || sel.GlobalAgg { |