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

Function writeComment

backend/plugin/schema/pg/metadata_migration.go:1454–1461  ·  view source on GitHub ↗
(out io.Writer, object, comment string)

Source from the content-addressed store, hash-verified

1452}
1453
1454func writeComment(out io.Writer, object, comment string) error {
1455 if comment == "" {
1456 _, err := fmt.Fprintf(out, "COMMENT ON %s IS NULL;\n\n", object)
1457 return err
1458 }
1459 _, err := fmt.Fprintf(out, "COMMENT ON %s IS '%s';\n\n", object, escapeSingleQuote(comment))
1460 return err
1461}
1462
1463func writeSchemaDiff(out *strings.Builder, schemaDiff *schema.SchemaDiff) error {
1464 switch schemaDiff.Action {

Callers 6

writeTableCommentDiffFunction · 0.85
writeColumnCommentDiffFunction · 0.85
writeCommentDiffFunction · 0.85
writeAlterSequenceFunction · 0.85
writeViewDiffFunction · 0.85

Calls 1

escapeSingleQuoteFunction · 0.85

Tested by

no test coverage detected