Closed
Description
What do you want to change?
Column names ending in "_id" are handled inconsistently when converting to Go field names. For example, app_id
becomes AppID
instead of AppId
. It would be a breaking change to fix this for all users.
I propose creating a new config option, use_capital_id
, that enables a more consistent naming scheme with no special handling for _id
columns. IE, they become Go fields ending in Id
.
This may seem nit-picky. But migrating a large existing application to sqlc is challenging. If the developers were consistent in naming Id columns (of which there are many), then it becomes much harder to drop in new sqlc generated objects. This change would save developers having to add a hundreds of rename rules.
What database engines need to be changed?
PostgreSQL
What programming language backends need to be changed?
Go