Given a bobgen.yaml with following replacements:
replacements:
- match:
name: "id"
replace: uint64
- match:
name: "team_id"
replace: uint64
And a generated models.shops like the following:
type Shop struct {
ID uint64 `db:"id,pk,autoincr" json:"id"`
TeamID uint64 `db:"team_id" json:"team_id"`
//...
}
And a SQL query that looks like this:
-- Shops
SELECT
`shops`.`id`,
`shops`.`team_id`
FROM
`shops`;
It will generate the result struct without looking at the replacements:
type ShopsRow = struct {
ID int32 `db:"id"`
TeamID int32 `db:"team_id"`
}
Of course you could annotate it, but I think it would be more natural if it defaults to using the replacements, which then could be overwritten with annotations.