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

Method RenderJoinTables

core/internal/dialect/sqlite.go:430–440  ·  view source on GitHub ↗
(ctx Context, sel *qcode.Select)

Source from the content-addressed store, hash-verified

428}
429
430func (d *SQLiteDialect) RenderJoinTables(ctx Context, sel *qcode.Select) {
431 for _, ob := range sel.OrderBy {
432 if ob.Var != "" {
433 ctx.WriteString(` JOIN (SELECT value, key as ord FROM json_each(`)
434 ctx.AddParam(Param{Name: ob.Var, Type: "json"})
435 ctx.WriteString(`)) AS _gj_ob_` + ob.Col.Name)
436 ctx.WriteString(` ON _gj_ob_` + ob.Col.Name + `.value = `)
437 ctx.ColWithTable(sel.Table, ob.Col.Name)
438 }
439 }
440}
441
442func (d *SQLiteDialect) RenderValArrayColumn(ctx Context, ex *qcode.Exp, table string, pid int32) {
443 ctx.WriteString(`SELECT value FROM json_each(`)

Callers

nothing calls this directly

Calls 3

WriteStringMethod · 0.65
AddParamMethod · 0.65
ColWithTableMethod · 0.65

Tested by

no test coverage detected