fix(writers): drop version stamps from generated output

Generated files carried the RelSpec version and build date, so every
rebuild produced a diff even when the schema was unchanged.

- bun, gorm, drizzle: remove the GeneratedBy template field and line
- pgsql, mssql, sqlite: emit a constant "-- Generated by RelSpec"
- bun: replace the version header test with a version-free assertion

pkg/buildinfo is unchanged and still backs the CLI version.
This commit is contained in:
2026-09-24 15:40:37 +02:00
parent f7b5d5f054
commit e1df3b7cee
11 changed files with 24 additions and 46 deletions
+6 -9
View File
@@ -4,16 +4,14 @@ import (
"sort"
"strings"
"git.warky.dev/wdevs/relspecgo/pkg/buildinfo"
"git.warky.dev/wdevs/relspecgo/pkg/models"
)
// TemplateData represents the data passed to the template for code generation
type TemplateData struct {
GeneratedBy string
Imports []string
Enums []*EnumData
Tables []*TableData
Imports []string
Enums []*EnumData
Tables []*TableData
}
// EnumData represents an enum in the schema
@@ -61,10 +59,9 @@ type IndexData struct {
// NewTemplateData creates a new TemplateData
func NewTemplateData() *TemplateData {
return &TemplateData{
GeneratedBy: buildinfo.GeneratedComment(),
Imports: make([]string, 0),
Enums: make([]*EnumData, 0),
Tables: make([]*TableData, 0),
Imports: make([]string, 0),
Enums: make([]*EnumData, 0),
Tables: make([]*TableData, 0),
}
}
+1 -2
View File
@@ -7,8 +7,7 @@ import (
// schemaTemplate defines the template for generating Drizzle schemas
const schemaTemplate = `// Code generated by relspecgo. DO NOT EDIT.
{{if .GeneratedBy}}// {{.GeneratedBy}}
{{end}}{{range .Imports}}{{.}}
{{range .Imports}}{{.}}
{{end}}
{{if .Enums}}
// Enums