MCPcopy
hub / github.com/dosco/graphjin / CompileFullQuery

Method CompileFullQuery

core/internal/dialect/cassandra.go:151–168  ·  view source on GitHub ↗

---- Query compilation ----

(ctx Context, qc *qcode.QCode)

Source from the content-addressed store, hash-verified

149// ---- Query compilation ----
150
151func (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
170func (b *casBuilder) buildNode(qc *qcode.QCode, sel *qcode.Select) (*casNode, error) {
171 if sel.GroupCols || sel.GlobalAgg {

Callers

nothing calls this directly

Calls 3

buildNodeMethod · 0.95
emitMethod · 0.95
SetErrorMethod · 0.65

Tested by

no test coverage detected