feat: add --type-map to override SQL-to-Go types in bun and gorm writers

Adds WriterOptions.TypeMappings and a repeatable --type-map sqltype=gotype
flag. Defaults are unchanged when no mapping is given. Closes #36 (bun/gorm).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Hermes Agent
2026-10-03 10:28:58 +02:00
co-authored by Claude Sonnet 5.5
parent b38f53c603
commit 948419ffd3
12 changed files with 230 additions and 0 deletions
+7
View File
@@ -83,6 +83,13 @@ type WriterOptions struct {
// SqlXxxArray wrapper types.
NullableArrays string
// TypeMappings overrides the SQL-to-Go type mapping of the code-generation
// writers (bun, gorm). Keys are SQL base types (aliases are canonicalized,
// see ParseTypeMappings), values are Go type expressions. Array columns
// use the override for their element type. Unmapped types keep the
// built-in defaults.
TypeMappings map[string]string
// Prisma7 enables Prisma 7-specific output for Prisma writers.
Prisma7 bool