MCPcopy Create free account
hub / github.com/daodst/chat / RowsNext

Method RowsNext

internal/sqlutil/trace.go:62–81  ·  view source on GitHub ↗
(c context.Context, rows driver.Rows, dest []driver.Value)

Source from the content-addressed store, hash-verified

60}
61
62func (in *traceInterceptor) RowsNext(c context.Context, rows driver.Rows, dest []driver.Value) error {
63 err := rows.Next(dest)
64 if err == io.EOF {
65 // For all cases, we call Next() n+1 times, the first to populate the initial dest, then eventually
66 // it will io.EOF. If we log on each Next() call we log the last element twice, so don't.
67 return err
68 }
69 cols := rows.Columns()
70 logrus.Debug(strings.Join(cols, " | "))
71
72 b := strings.Builder{}
73 for i, val := range dest {
74 b.WriteString(fmt.Sprintf("%q", val))
75 if i+1 <= len(dest)-1 {
76 b.WriteString(" | ")
77 }
78 }
79 logrus.Debug(b.String())
80 return err
81}
82
83func trackGoID(query string) {
84 thisGoID := goid()

Callers

nothing calls this directly

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected