MCPcopy Create free account
hub / github.com/bytebase/bytebase / toString

Method toString

backend/plugin/schema/clickhouse/state.go:270–280  ·  view source on GitHub ↗
(buf io.StringWriter)

Source from the content-addressed store, hash-verified

268}
269
270func (v *viewState) toString(buf io.StringWriter) error {
271 stmt := fmt.Sprintf("CREATE OR REPLACE VIEW %s AS (%s)", v.name, util.TrimStatement(v.definition))
272 if v.comment != "" {
273 stmt += fmt.Sprintf(" COMMENT '%s'", v.comment)
274 }
275 stmt += ";\n"
276 if _, err := buf.WriteString(stmt); err != nil {
277 return err
278 }
279 return nil
280}

Callers

nothing calls this directly

Calls 1

TrimStatementFunction · 0.92

Tested by

no test coverage detected