Title: bug if column and param share the same name · Issue #4354 · sqlc-dev/sqlc · GitHub
Open Graph Title: bug if column and param share the same name · Issue #4354 · sqlc-dev/sqlc
X Title: bug if column and param share the same name · Issue #4354 · sqlc-dev/sqlc
Description: Version 1.30.0 What happened? A bug happened! sql: -- name: GetUserByEmail :one SELECT email FROM users WHERE email = sqlc.arg(email); generated: func (q *Queries) GetUserByEmail(ctx context.Context, email string) (string, error) { row :...
Open Graph Description: Version 1.30.0 What happened? A bug happened! sql: -- name: GetUserByEmail :one SELECT email FROM users WHERE email = sqlc.arg(email); generated: func (q *Queries) GetUserByEmail(ctx context.Contex...
X Description: Version 1.30.0 What happened? A bug happened! sql: -- name: GetUserByEmail :one SELECT email FROM users WHERE email = sqlc.arg(email); generated: func (q *Queries) GetUserByEmail(ctx context.Contex...
Opengraph URL: https://github.com/sqlc-dev/sqlc/issues/4354
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bug if column and param share the same name","articleBody":"### Version\n\n1.30.0\n\n### What happened?\n\nA bug happened!\nsql:\n```\n-- name: GetUserByEmail :one\nSELECT email\nFROM users\nWHERE email = sqlc.arg(email);\n```\ngenerated:\n```\nfunc (q *Queries) GetUserByEmail(ctx context.Context, email string) (string, error) {\n\trow := q.db.QueryRow(ctx, getUserByEmail, email)\n\terr := row.Scan(\u0026email)\n\treturn email, err\n}\n```\n\non ErrNoRows, the function GetUserByEmail returns the input email... expected an empty string.\nmaybe create a separate string var like what is done with other types? after a little testing, this only happens when the names are the same xD\n\n\n### Relevant log output\n\n```shell\n\n```\n\n### Database schema\n\n```sql\n\n```\n\n### SQL queries\n\n```sql\n\n```\n\n### Configuration\n\n```yaml\n\n```\n\n### Playground URL\n\n_No response_\n\n### What operating system are you using?\n\nWindows\n\n### What database engines are you using?\n\nPostgreSQL\n\n### What type of code are you generating?\n\nGo","author":{"url":"https://github.com/canvasbushi","@type":"Person","name":"canvasbushi"},"datePublished":"2026-03-24T16:08:52.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/4354/sqlc/issues/4354"}
| 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:e3d24c6c-2139-dea2-30a8-9a2a05e1bcd9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D866:204E27:A8C33F4:AC28BC9:6A50B131 |
| html-safe-nonce | 148768b7b8714b166aedfb7c67d660bb7ce0f42d73c0c6e3957cd076c1ec9f81 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODY2OjIwNEUyNzpBOEMzM0Y0OkFDMjhCQzk6NkE1MEIxMzEiLCJ2aXNpdG9yX2lkIjoiODU4ODE4MTQ5MDA4NTg1MDA5IiwicmVnaW9uX2VkZ2UiOiJzZWEiLCJyZWdpb25fcmVuZGVyIjoic2VhIn0= |
| visitor-hmac | b32f134dc45c15258f492e89976b9067e83c6cd3b7aa6826a5a822fb24c1d839 |
| hovercard-subject-tag | issue:4129055284 |
| 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/4354/issue_layout |
| twitter:image | https://opengraph.githubassets.com/77df9bbf68fac88b1e49e6b091920f51ab09fa6885769d1d338a23d6315b27a4/sqlc-dev/sqlc/issues/4354 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/77df9bbf68fac88b1e49e6b091920f51ab09fa6885769d1d338a23d6315b27a4/sqlc-dev/sqlc/issues/4354 |
| og:image:alt | Version 1.30.0 What happened? A bug happened! sql: -- name: GetUserByEmail :one SELECT email FROM users WHERE email = sqlc.arg(email); generated: func (q *Queries) GetUserByEmail(ctx context.Contex... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | canvasbushi |
| 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