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

Method CompileFullQuery

core/internal/dialect/clickhouse.go:176–193  ·  view source on GitHub ↗

---- Query compilation ----

(ctx Context, qc *qcode.QCode)

Source from the content-addressed store, hash-verified

174// ---- Query compilation ----
175
176func (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
195func (b *chBuilder) buildNode(qc *qcode.QCode, sel *qcode.Select) (*chNode, error) {
196 n := &chNode{

Callers

nothing calls this directly

Calls 4

buildNodeMethod · 0.95
emitMethod · 0.95
SetErrorMethod · 0.65
GetSecPrefixMethod · 0.65

Tested by

no test coverage detected