MCPcopy Index your code
hub / github.com/dosco/graphjin / RenderJSONPath

Method RenderJSONPath

core/internal/dialect/sqlite.go:245–257  ·  view source on GitHub ↗
(ctx Context, table, col string, path []string)

Source from the content-addressed store, hash-verified

243}
244
245func (d *SQLiteDialect) RenderJSONPath(ctx Context, table, col string, path []string) {
246 // SQLite JSON path syntax: json_extract(column, '$.path1.path2')
247 ctx.WriteString(`json_extract(`)
248 ctx.ColWithTable(table, col)
249 ctx.WriteString(`, '$.`)
250 for i, pathElement := range path {
251 if i > 0 {
252 ctx.WriteString(`.`)
253 }
254 ctx.WriteString(pathElement)
255 }
256 ctx.WriteString(`')`)
257}
258
259func (d *SQLiteDialect) RenderList(ctx Context, ex *qcode.Exp) {
260 ctx.WriteString(`(`)

Callers

nothing calls this directly

Calls 2

WriteStringMethod · 0.65
ColWithTableMethod · 0.65

Tested by

no test coverage detected