Title: consistent field naming for _id columns · Issue #3306 · sqlc-dev/sqlc · GitHub
Open Graph Title: consistent field naming for _id columns · Issue #3306 · sqlc-dev/sqlc
X Title: consistent field naming for _id columns · Issue #3306 · sqlc-dev/sqlc
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...
Open Graph 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 cha...
X 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 br...
Opengraph URL: https://github.com/sqlc-dev/sqlc/issues/3306
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"consistent field naming for _id columns","articleBody":"### What do you want to change?\n\nColumn 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. \r\n\r\nI 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` . \r\n\r\nThis 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.\r\n \n\n### What database engines need to be changed?\n\nPostgreSQL\n\n### What programming language backends need to be changed?\n\nGo","author":{"url":"https://github.com/bassettb","@type":"Person","name":"bassettb"},"datePublished":"2024-04-01T13:43:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/3306/sqlc/issues/3306"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:26f8a594-6f8a-8785-c52c-ebf30e94ac77 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CE5A:2371E7:2A55E98:3A680E3:6A505F63 |
| html-safe-nonce | 7cabfe8e8244adb799bee3daf1722ce01bb06cb64b8bb8a29a3d513642e52336 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRTVBOjIzNzFFNzoyQTU1RTk4OjNBNjgwRTM6NkE1MDVGNjMiLCJ2aXNpdG9yX2lkIjoiNjY0NjkyOTM0MzY5OTI0Njk0NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fbfed88a4579a7932b60b36aa26fdefd619e100c1df1473ae2c53347ed429ec6 |
| hovercard-subject-tag | issue:2218295346 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/sqlc-dev/sqlc/3306/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b9d6cead22469a6f57f5182eb84a24addc870fd69a3e6f04d9107b5a9a5e151a/sqlc-dev/sqlc/issues/3306 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b9d6cead22469a6f57f5182eb84a24addc870fd69a3e6f04d9107b5a9a5e151a/sqlc-dev/sqlc/issues/3306 |
| og:image:alt | 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 cha... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bassettb |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| turbo-cache-control | no-preview |
| go-import | github.com/sqlc-dev/sqlc git https://github.com/sqlc-dev/sqlc.git |
| octolytics-dimension-user_id | 136738596 |
| octolytics-dimension-user_login | sqlc-dev |
| octolytics-dimension-repository_id | 193160679 |
| octolytics-dimension-repository_nwo | sqlc-dev/sqlc |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 193160679 |
| octolytics-dimension-repository_network_root_nwo | sqlc-dev/sqlc |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7ac0ad2f2c7e4b9056617355fd9e33e22b0c8df9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width