Title: Resolving references to CTE Columns fails · Issue #3585 · sqlc-dev/sqlc · GitHub
Open Graph Title: Resolving references to CTE Columns fails · Issue #3585 · sqlc-dev/sqlc
X Title: Resolving references to CTE Columns fails · Issue #3585 · sqlc-dev/sqlc
Description: Version 1.27.0 What happened? Resolving references to multiple CTE's with arguments fails. This is a duplicate of #3219, but 3219 has been closed even thought the issue still persists and the relevant PR is not merged. PR to fix this iss...
Open Graph Description: Version 1.27.0 What happened? Resolving references to multiple CTE's with arguments fails. This is a duplicate of #3219, but 3219 has been closed even thought the issue still persists and the relev...
X Description: Version 1.27.0 What happened? Resolving references to multiple CTE's with arguments fails. This is a duplicate of #3219, but 3219 has been closed even thought the issue still persists and the r...
Opengraph URL: https://github.com/sqlc-dev/sqlc/issues/3585
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Resolving references to CTE Columns fails","articleBody":"### Version\r\n\r\n1.27.0\r\n\r\n### What happened?\r\n\r\nResolving references to multiple CTE's with arguments fails.\r\n\r\nThis is a duplicate of #3219, but 3219 has been closed even thought the issue still persists and the relevant PR is not merged.\r\n\r\nPR to fix this issue: https://github.com/sqlc-dev/sqlc/pull/3220\r\n\r\n\r\n\r\n### Relevant log output\r\n\r\n```shell\r\nsqlc generate failed.\r\n# package \r\nquery.sql:5:28: table alias \"t1_ids\" does not exist\r\n```\r\n\r\n\r\n### Database schema\r\n\r\n```sql\r\nCREATE TABLE t1\r\n(\r\n id SERIAL NOT NULL PRIMARY KEY\r\n);\r\n```\r\n\r\n\r\n### SQL queries\r\n\r\n```sql\r\n-- name: CTERef :one\r\nWITH t1_ids AS (\r\n SELECT id FROM t1\r\n)\r\nSELECT * FROM t1_ids WHERE t1_ids.id = sqlc.arg('id');\r\n```\r\n\r\n\r\n### Configuration\r\n\r\n```yaml\r\n{\r\n \"version\": \"2\",\r\n \"sql\": [{\r\n \"schema\": \"schema.sql\",\r\n \"queries\": \"query.sql\",\r\n \"engine\": \"postgresql\",\r\n \"gen\": {\r\n \"go\": {\r\n \"out\": \"db\"\r\n }\r\n }\r\n }]\r\n}\r\n\r\n```\r\n\r\n\r\n### Playground URL\r\n\r\nhttps://play.sqlc.dev/p/9048b486f822c300301650867612e42bef8f8d512dfd12d84ad3a4cd210f4ef7\r\n\r\n### What operating system are you using?\r\n\r\nLinux\r\n\r\n### What database engines are you using?\r\n\r\nPostgreSQL\r\n\r\n### What type of code are you generating?\r\n\r\nGo","author":{"url":"https://github.com/simonklee","@type":"Person","name":"simonklee"},"datePublished":"2024-09-06T08:50:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/3585/sqlc/issues/3585"}
| 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:947754f3-95b8-69a4-80f0-c69e0f788a7a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C3B2:154B81:F394D5:148443A:6A5174C2 |
| html-safe-nonce | 18006d7dc1fcab552d17ec1ae6e99ceacfc37ef154a6630c69265fbfa34aae67 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDM0IyOjE1NEI4MTpGMzk0RDU6MTQ4NDQzQTo2QTUxNzRDMiIsInZpc2l0b3JfaWQiOiIzMjEwMjM3Nzg3Nzk5Mzg1MjgzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6381797b6232d8df74a4e946384649cbad6b7bd27adf2b8fb8e2caed3cc02d7b |
| hovercard-subject-tag | issue:2509881147 |
| 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/3585/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a808557df080472accb5bdab2cc2f86a5e30cd8e9473640bf78aeeae737aa9c4/sqlc-dev/sqlc/issues/3585 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a808557df080472accb5bdab2cc2f86a5e30cd8e9473640bf78aeeae737aa9c4/sqlc-dev/sqlc/issues/3585 |
| og:image:alt | Version 1.27.0 What happened? Resolving references to multiple CTE's with arguments fails. This is a duplicate of #3219, but 3219 has been closed even thought the issue still persists and the relev... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | simonklee |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 | b19955a9dd40fd99462443f7911b522d7216776a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width