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

Function writeRules

backend/plugin/schema/pg/get_database_definition.go:1099–1110  ·  view source on GitHub ↗
(out io.Writer, _ string, _ string, rules []*storepb.RuleMetadata)

Source from the content-addressed store, hash-verified

1097}
1098
1099func writeRules(out io.Writer, _ string, _ string, rules []*storepb.RuleMetadata) error {
1100 for _, rule := range rules {
1101 // Write the full rule definition
1102 if _, err := io.WriteString(out, rule.Definition); err != nil {
1103 return err
1104 }
1105 if _, err := io.WriteString(out, "\n\n"); err != nil {
1106 return err
1107 }
1108 }
1109 return nil
1110}
1111
1112// objectIDSeparator joins schema + object into a map/graph key. NUL cannot
1113// legally appear in a PostgreSQL identifier, so this avoids ambiguity when

Callers 3

GetTableDefinitionFunction · 0.85
GetViewDefinitionFunction · 0.85
writeSchemaRulesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected