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

Function writeCreateRegularIndex

backend/plugin/schema/pg/metadata_migration.go:1395–1406  ·  view source on GitHub ↗
(out *strings.Builder, schemaName, tableName string, index *storepb.IndexMetadata, useOnlyClause bool)

Source from the content-addressed store, hash-verified

1393}
1394
1395func writeCreateRegularIndex(out *strings.Builder, schemaName, tableName string, index *storepb.IndexMetadata, useOnlyClause bool) error {
1396 if index.GetDefinition() != "" {
1397 if err := writeDefinitionStatement(out, index.GetDefinition()); err != nil {
1398 return err
1399 }
1400 if index.GetComment() != "" {
1401 return writeIndexComment(out, schemaName, index)
1402 }
1403 return nil
1404 }
1405 return writeIndex(out, schemaName, tableName, index, useOnlyClause)
1406}
1407
1408func writeTableCommentDiff(out *strings.Builder, schemaName, tableName, oldComment, newComment string) error {
1409 if oldComment == newComment {

Calls 5

writeDefinitionStatementFunction · 0.85
writeIndexCommentFunction · 0.70
writeIndexFunction · 0.70
GetDefinitionMethod · 0.45
GetCommentMethod · 0.45

Tested by

no test coverage detected