Give every table its path in one pass, name it in every message, read the layout probes through predicates, and leave the shell to the CLI

This commit is contained in:
2026-09-18 20:02:08 +02:00
parent 2d08bf4b32
commit d5d9c2655e
7 changed files with 72 additions and 37 deletions
+2 -2
View File
@@ -141,8 +141,8 @@ func (f *Generator) FakeRecord(path string) (*Record, error) {
}
shape := f.recordShapeOf(n)
if errors.Is(shape.err, errNoColumns) {
column := path[strings.LastIndex(path, ".")+1:]
return nil, fmt.Errorf("fejkdata: %s %w; render it as a column of one: '{\"format\":\"\",\"%s\":\"{/%s}\"}'", path, shape.err, column, path)
ns := names(segments)
return nil, fmt.Errorf(`fejkdata: %s %w; render it as a column of one: {"format":"","%s":"{/%s}"}`, path, shape.err, ns[len(ns)-1], path)
}
if shape.err != nil {
return nil, fmt.Errorf("fejkdata: %s %w", path, shape.err)