You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
Thanks for the feature request. Instead of a specific setting for id, I think the solution proposed at the bottom of #2161 is the best, giving you the ability to configure with words are all caps.
Activity
kyleconroy commentedon Apr 1, 2024
Thanks for the feature request. Instead of a specific setting for id, I think the solution proposed at the bottom of #2161 is the best, giving you the ability to configure with words are all caps.
Closing as a duplicate of #2161
kyleconroy commentedon Apr 1, 2024
Fixed in #3308