Title: keyword with causing "column does not exist" · Issue #1515 · sqlc-dev/sqlc · GitHub
Open Graph Title: keyword with causing "column does not exist" · Issue #1515 · sqlc-dev/sqlc
X Title: keyword with causing "column does not exist" · Issue #1515 · sqlc-dev/sqlc
Description: Version 1.12.0 What happened? I wanted to make an update query that also returns some more detailed data from other tables. The update query itself works fine, but the "WITH" statement causes the "column does not exist" error during code...
Open Graph Description: Version 1.12.0 What happened? I wanted to make an update query that also returns some more detailed data from other tables. The update query itself works fine, but the "WITH" statement causes the "...
X Description: Version 1.12.0 What happened? I wanted to make an update query that also returns some more detailed data from other tables. The update query itself works fine, but the "WITH" statement ca...
Opengraph URL: https://github.com/sqlc-dev/sqlc/issues/1515
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"keyword with causing \"column does not exist\"","articleBody":"### Version\n\n1.12.0\n\n### What happened?\n\nI wanted to make an update query that also returns some more detailed data from other tables. The update query itself works fine, but the \"WITH\" statement causes the \"column does not exist\" error during code generation in already tested update query.\n\n### Relevant log output\n\n_No response_\n\n### Database schema\n\n```sql\ncreate table attribute_value\r\n(\r\n id bigserial not null,\r\n val text not null,\r\n attribute bigint not null\r\n);\r\n\r\ncreate table attribute\r\n(\r\n id bigserial not null,\r\n name text not null\r\n);\n```\n\n\n### SQL queries\n\n```sql\n-- name: UpdateAttributeValueDoesntWork :one\r\nwith updated_attribute as (UPDATE attribute_value\r\n SET\r\n val = CASE WHEN @filter_value::bool THEN @value ELSE val END\r\n WHERE attribute_value.id = @id\r\n RETURNING id,attribute,val)\r\nselect updated_attribute.id, val, name\r\nfrom updated_attribute\r\n left join attribute on updated_attribute.attribute = attribute.id;\r\n\t\t \r\n-- name: UpdateAttributeValueWorks :one\r\nUPDATE attribute_value\r\n SET\r\n val = CASE WHEN @filter_value::bool THEN @value ELSE val END\r\n WHERE attribute_value.id = @id\r\n RETURNING id,attribute,val;\n```\n\n\n### Configuration\n\n_No response_\n\n### Playground URL\n\nhttps://play.sqlc.dev/p/ba79ccad12759729ce4f260f70f3250de323a0050d2172e53d06f5ec1f83ee0d\n\n### What operating system are you using?\n\nLinux\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/konekomind","@type":"Person","name":"konekomind"},"datePublished":"2022-03-28T10:25:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/1515/sqlc/issues/1515"}
| 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:b6782ad7-feda-2f9f-dca9-fd81abd8ebba |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB04:1DD869:AD4540E:B096B41:6A50B27A |
| html-safe-nonce | 9dbdc347c4485c40e5e19697f7f7d9d44a071f4da518912b6fbfba26741d598a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjA0OjFERDg2OTpBRDQ1NDBFOkIwOTZCNDE6NkE1MEIyN0EiLCJ2aXNpdG9yX2lkIjoiMjU4NTA1NTU1Nzg1MDI4MDU3MCIsInJlZ2lvbl9lZGdlIjoic2VhIiwicmVnaW9uX3JlbmRlciI6InNlYSJ9 |
| visitor-hmac | 0afb6f8dd9ff98d4f18e7b3fd03dc45b87f635280c45aa5fe8cf66860280edcd |
| hovercard-subject-tag | issue:1183223716 |
| 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/1515/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a70b3e6eac5cbc1ae7985c252544cf8fcb40cc33b4fc4979f25c4600777b6d36/sqlc-dev/sqlc/issues/1515 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a70b3e6eac5cbc1ae7985c252544cf8fcb40cc33b4fc4979f25c4600777b6d36/sqlc-dev/sqlc/issues/1515 |
| og:image:alt | Version 1.12.0 What happened? I wanted to make an update query that also returns some more detailed data from other tables. The update query itself works fine, but the "WITH" statement causes the "... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | konekomind |
| hostname | github.com |
| expected-hostname | github.com |
| None | 63772747707af4093f0d5fc7aa1bb3bb55f412a9865207c4f421aa34c64cc404 |
| 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 | ded53fe94e3ff1bb4dbf8cc77e285396c92580fb |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width