MCPcopy Create free account
hub / github.com/donatj/sqlread / showColumns

Function showColumns

cmd/sqlread/query.go:74–88  ·  view source on GitHub ↗
(tree sqlread.SummaryTree, sctbl string, w DataWriter)

Source from the content-addressed store, hash-verified

72}
73
74func showColumns(tree sqlread.SummaryTree, sctbl string, w DataWriter) error {
75 tbl, tok := tree[sctbl]
76 if !tok {
77 return fmt.Errorf("table `%s` not found", sctbl)
78 }
79 for _, col := range tbl.Cols {
80 err := w.Write([]string{col.Name, col.Type})
81 if err != nil {
82 return err
83 }
84 }
85 w.Flush()
86
87 return nil
88}
89
90func showCreateTable(tree sqlread.SummaryTree, sctbl string, buff io.ReaderAt, w DataWriter) error {
91 tbl, tok := tree[sctbl]

Callers 1

interactiveFunction · 0.85

Calls 2

WriteMethod · 0.80
FlushMethod · 0.65

Tested by

no test coverage detected