feat(dbml): support multiline table notes in DBML
* Add parsing for triple-quoted table notes in DBML * Update writer to format multiline notes correctly * Enhance tests for multiline table notes handling
This commit is contained in:
@@ -2,6 +2,7 @@ package drizzle
|
||||
|
||||
import (
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"git.warky.dev/wdevs/relspecgo/pkg/models"
|
||||
)
|
||||
@@ -199,13 +200,16 @@ func NewIndexData(index *models.Index, tableVar string, tm *TypeMapper) *IndexDa
|
||||
|
||||
// formatComment combines description and comment into a single comment string
|
||||
func formatComment(description, comment string) string {
|
||||
var result string
|
||||
if description != "" && comment != "" {
|
||||
return description + " - " + comment
|
||||
result = description + " - " + comment
|
||||
} else if description != "" {
|
||||
result = description
|
||||
} else {
|
||||
result = comment
|
||||
}
|
||||
if description != "" {
|
||||
return description
|
||||
}
|
||||
return comment
|
||||
// Generated TypeScript comments are emitted on a single source line.
|
||||
return strings.Join(strings.Fields(result), " ")
|
||||
}
|
||||
|
||||
// joinStrings joins a slice of strings with a separator
|
||||
|
||||
Reference in New Issue
Block a user