Title: Generated code uses Go keyword resulting in a syntax error · Issue #2267 · sqlc-dev/sqlc · GitHub
Open Graph Title: Generated code uses Go keyword resulting in a syntax error · Issue #2267 · sqlc-dev/sqlc
X Title: Generated code uses Go keyword resulting in a syntax error · Issue #2267 · sqlc-dev/sqlc
Description: Version v1.18.0 What happened? MySQL config : query_parameter_limit= 3 mysql table has field named switch, then gen code will like this: func (q *Queries) GetSomething(ctx context.Context, name string, switch SomethingSwitch) (*Something...
Open Graph Description: Version v1.18.0 What happened? MySQL config : query_parameter_limit= 3 mysql table has field named switch, then gen code will like this: func (q *Queries) GetSomething(ctx context.Context, name str...
X Description: Version v1.18.0 What happened? MySQL config : query_parameter_limit= 3 mysql table has field named switch, then gen code will like this: func (q *Queries) GetSomething(ctx context.Context, name str...
Opengraph URL: https://github.com/sqlc-dev/sqlc/issues/2267
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Generated code uses Go keyword resulting in a syntax error","articleBody":"### Version\r\nv1.18.0\r\n\r\n### What happened?\r\nMySQL \r\nconfig : `query_parameter_limit`= 3\r\n\r\nmysql table has field named `switch`, then gen code will like this: \r\n```golang\r\nfunc (q *Queries) GetSomething(ctx context.Context, name string, switch SomethingSwitch) (*Something, error) \r\n```\r\nbut `switch` is golang keyword. Does sqlc need to be compatible with this situation?\r\n\r\n### Playground URL\r\nhttps://play.sqlc.dev/p/3f5d54e71a2309b4fa02b40cb1d2322f9eccf6359cac47d3b22371a6628baea2","author":{"url":"https://github.com/J404J","@type":"Person","name":"J404J"},"datePublished":"2023-05-06T04:14:14.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2267/sqlc/issues/2267"}
| 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:357b7bef-6a2c-3142-b2d8-0fb8d2ad0c95 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9E54:1F14:444304C:5F89967:6A50FBAB |
| html-safe-nonce | 9364bb344e9abe8c5ec8c46f1dc95e9bb2b296a0669958860e3f757ff231317b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTU0OjFGMTQ6NDQ0MzA0Qzo1Rjg5OTY3OjZBNTBGQkFCIiwidmlzaXRvcl9pZCI6IjMyNDg5MjQ0MDA3NzUzOTYyNjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 524944db574eaf48c8efe79eaa57a252cf9c27f8ada76e9e1ba2f0ea170fd1cb |
| hovercard-subject-tag | issue:1698427864 |
| 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/2267/issue_layout |
| twitter:image | https://opengraph.githubassets.com/27b8b3d33ff06fe6143029e9f4a6c99953f8f843543d1adca8a6c95642e817b7/sqlc-dev/sqlc/issues/2267 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/27b8b3d33ff06fe6143029e9f4a6c99953f8f843543d1adca8a6c95642e817b7/sqlc-dev/sqlc/issues/2267 |
| og:image:alt | Version v1.18.0 What happened? MySQL config : query_parameter_limit= 3 mysql table has field named switch, then gen code will like this: func (q *Queries) GetSomething(ctx context.Context, name str... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | J404J |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5266e58c17a510c403505cc811606465e90a881d2007ee7df1c4800d5c659838 |
| 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 | 8d836581d020676cc0ef4a83cd2fe17e4af02c3d |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width