Repository navigation
MySql pointers #3807
|
Is there a specific reason that Setting manual overrides seems to have no effect: |
Replies: 1 comment
|
For the override shown, the missing piece is For a nullable, signed MySQL version: "2"
sql:
- engine: "mysql"
schema: "schema.sql"
queries: "query.sql"
gen:
go:
package: "db"
out: "db"
overrides:
- db_type: "int"
nullable: true
go_type:
type: "int"
pointer: trueAdapt the paths/package to your existing configuration, then regenerate. The explicit override chooses The override documentation explains both nullability matching and The blanket option is named |
For the override shown, the missing piece is
nullable: true. Adb_typeoverride defaults to matching non-nullable columns, so it won't replace the type of a nullable column that would otherwise becomesql.NullInt32.For a nullable, signed MySQL
INT, put this under your Go generation settings (v2 configuration):Adapt the paths/package to your existing configuration, then regenerate. The explicit ove…