style(report, writers, graphql, prisma, typeorm): replace sb.WriteString with fmt.Fprintf for consistency
All checks were successful
CI / Test (1.24) (push) Successful in -26m1s
CI / Test (1.25) (push) Successful in -25m59s
CI / Build (push) Successful in -29m11s
CI / Lint (push) Successful in -28m32s
Integration Tests / Integration Tests (push) Successful in -29m16s
Release / Build and Release (push) Successful in -26m36s
All checks were successful
CI / Test (1.24) (push) Successful in -26m1s
CI / Test (1.25) (push) Successful in -25m59s
CI / Build (push) Successful in -29m11s
CI / Lint (push) Successful in -28m32s
Integration Tests / Integration Tests (push) Successful in -29m16s
Release / Build and Release (push) Successful in -26m36s
This commit is contained in:
@@ -62,10 +62,10 @@ func (w *Writer) databaseToDBML(d *models.Database) string {
|
||||
var sb strings.Builder
|
||||
|
||||
if d.Description != "" {
|
||||
sb.WriteString(fmt.Sprintf("// %s\n", d.Description))
|
||||
fmt.Fprintf(&sb, "// %s\n", d.Description)
|
||||
}
|
||||
if d.Comment != "" {
|
||||
sb.WriteString(fmt.Sprintf("// %s\n", d.Comment))
|
||||
fmt.Fprintf(&sb, "// %s\n", d.Comment)
|
||||
}
|
||||
if d.Description != "" || d.Comment != "" {
|
||||
sb.WriteString("\n")
|
||||
@@ -94,7 +94,7 @@ func (w *Writer) schemaToDBML(schema *models.Schema) string {
|
||||
var sb strings.Builder
|
||||
|
||||
if schema.Description != "" {
|
||||
sb.WriteString(fmt.Sprintf("// Schema: %s - %s\n", schema.Name, schema.Description))
|
||||
fmt.Fprintf(&sb, "// Schema: %s - %s\n", schema.Name, schema.Description)
|
||||
}
|
||||
|
||||
for _, table := range schema.Tables {
|
||||
@@ -110,10 +110,10 @@ func (w *Writer) tableToDBML(t *models.Table) string {
|
||||
var sb strings.Builder
|
||||
|
||||
tableName := fmt.Sprintf("%s.%s", t.Schema, t.Name)
|
||||
sb.WriteString(fmt.Sprintf("Table %s {\n", tableName))
|
||||
fmt.Fprintf(&sb, "Table %s {\n", tableName)
|
||||
|
||||
for _, column := range t.Columns {
|
||||
sb.WriteString(fmt.Sprintf(" %s %s", column.Name, column.Type))
|
||||
fmt.Fprintf(&sb, " %s %s", column.Name, column.Type)
|
||||
|
||||
var attrs []string
|
||||
if column.IsPrimaryKey {
|
||||
@@ -138,11 +138,11 @@ func (w *Writer) tableToDBML(t *models.Table) string {
|
||||
}
|
||||
|
||||
if len(attrs) > 0 {
|
||||
sb.WriteString(fmt.Sprintf(" [%s]", strings.Join(attrs, ", ")))
|
||||
fmt.Fprintf(&sb, " [%s]", strings.Join(attrs, ", "))
|
||||
}
|
||||
|
||||
if column.Comment != "" {
|
||||
sb.WriteString(fmt.Sprintf(" // %s", column.Comment))
|
||||
fmt.Fprintf(&sb, " // %s", column.Comment)
|
||||
}
|
||||
sb.WriteString("\n")
|
||||
}
|
||||
@@ -161,9 +161,9 @@ func (w *Writer) tableToDBML(t *models.Table) string {
|
||||
indexAttrs = append(indexAttrs, fmt.Sprintf("type: %s", index.Type))
|
||||
}
|
||||
|
||||
sb.WriteString(fmt.Sprintf(" (%s)", strings.Join(index.Columns, ", ")))
|
||||
fmt.Fprintf(&sb, " (%s)", strings.Join(index.Columns, ", "))
|
||||
if len(indexAttrs) > 0 {
|
||||
sb.WriteString(fmt.Sprintf(" [%s]", strings.Join(indexAttrs, ", ")))
|
||||
fmt.Fprintf(&sb, " [%s]", strings.Join(indexAttrs, ", "))
|
||||
}
|
||||
sb.WriteString("\n")
|
||||
}
|
||||
@@ -172,7 +172,7 @@ func (w *Writer) tableToDBML(t *models.Table) string {
|
||||
|
||||
note := strings.TrimSpace(t.Description + " " + t.Comment)
|
||||
if note != "" {
|
||||
sb.WriteString(fmt.Sprintf("\n Note: '%s'\n", note))
|
||||
fmt.Fprintf(&sb, "\n Note: '%s'\n", note)
|
||||
}
|
||||
|
||||
sb.WriteString("}\n")
|
||||
|
||||
Reference in New Issue
Block a user