feat(writers): stamp RelSpec version in generated headers; preserve DBML column order

- Add pkg/buildinfo with Version/BuildDate (set via ldflags, VCS fallback);
  cmd/relspec now sources version info from it
- Emit "RelSpec <version> (built: <date>)" in generated file headers for
  bun, gorm, drizzle, pgsql (incl. migration), mssql, sqlite writers
- pgsql writer: getSortedColumns now sorts by Sequence then Name so the
  streaming WriteSchema/WriteDatabase path preserves source column order
- dbml reader: mergeTable re-bases merged-in column Sequence values past the
  existing max, fixing colliding sequences (and alphabetical fallback) when a
  table is split across multiple DBML files
- Tests for bun/gorm header + column order, and dbml multi-file merge ordering
This commit is contained in:
2026-09-10 22:08:49 +02:00
parent 58e46e5b59
commit 19a2cc1fe3
17 changed files with 214 additions and 65 deletions
+2 -1
View File
@@ -7,7 +7,8 @@ import (
// modelTemplate defines the template for generating GORM models
const modelTemplate = `// Code generated by relspecgo. DO NOT EDIT.
package {{.PackageName}}
{{if .GeneratedBy}}// {{.GeneratedBy}}
{{end}}package {{.PackageName}}
{{if .Imports -}}
import (