Title: Resolving reference to CTE column fails · Issue #3219 · sqlc-dev/sqlc · GitHub
Open Graph Title: Resolving reference to CTE column fails · Issue #3219 · sqlc-dev/sqlc
X Title: Resolving reference to CTE column fails · Issue #3219 · sqlc-dev/sqlc
Description: Version 1.25.0 What happened? Resolving references to multiple CTE's with arguments fails. Relevant log output sqlc generate failed. # package query.sql:5:28: table alias "t1_ids" does not exist Database schema CREATE TABLE t1 ( id SERIA...
Open Graph Description: Version 1.25.0 What happened? Resolving references to multiple CTE's with arguments fails. Relevant log output sqlc generate failed. # package query.sql:5:28: table alias "t1_ids" does not exist Da...
X Description: Version 1.25.0 What happened? Resolving references to multiple CTE's with arguments fails. Relevant log output sqlc generate failed. # package query.sql:5:28: table alias "t1_ids" doe...
Opengraph URL: https://github.com/sqlc-dev/sqlc/issues/3219
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Resolving reference to CTE column fails","articleBody":"### Version\n\n1.25.0\n\n### What happened?\n\nResolving references to multiple CTE's with arguments fails.\n\n### Relevant log output\n\n```shell\nsqlc generate failed.\r\n# package \r\nquery.sql:5:28: table alias \"t1_ids\" does not exist\n```\n\n\n### Database schema\n\n```sql\nCREATE TABLE t1\r\n(\r\n id SERIAL NOT NULL PRIMARY KEY\r\n);\n```\n\n\n### SQL queries\n\n```sql\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');\n```\n\n\n### Configuration\n\n```yaml\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}\n```\n\n\n### Playground URL\n\nhttps://play.sqlc.dev/p/9048b486f822c300301650867612e42bef8f8d512dfd12d84ad3a4cd210f4ef7\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/simonklee","@type":"Person","name":"simonklee"},"datePublished":"2024-02-24T23:47:28.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/3219/sqlc/issues/3219"}
| 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:0eb6a8f8-815e-dbde-94d4-eac50002cf5f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BB30:113906:9D82B4:D63DAA:6A515B09 |
| html-safe-nonce | 77c8da468eb7cc44bc4f6f97a3fa95f90b0e9c4861f2431a58d959aa6cd05d7a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjMwOjExMzkwNjo5RDgyQjQ6RDYzREFBOjZBNTE1QjA5IiwidmlzaXRvcl9pZCI6IjgwNzk4NTA5MTE3NzI1MzE0NjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 24272fde4eb149263c84406967f71e3237fcf8c50a49b55664d49ec135b6bbb8 |
| hovercard-subject-tag | issue:2152524588 |
| 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/3219/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dfd5408a782e86fcc3dd3253dd1b6abdbfd3417630568b8cbf64c46c4acc6156/sqlc-dev/sqlc/issues/3219 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dfd5408a782e86fcc3dd3253dd1b6abdbfd3417630568b8cbf64c46c4acc6156/sqlc-dev/sqlc/issues/3219 |
| og:image:alt | Version 1.25.0 What happened? Resolving references to multiple CTE's with arguments fails. Relevant log output sqlc generate failed. # package query.sql:5:28: table alias "t1_ids" does not exist Da... |
| 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 | 6f17634ed2af1d116850bcea6c63a70a4d72970f33ade1dd3eef3764b7e16994 |
| 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 | 2d32229a0a79708ee9a4f132f630b36d58b4495a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width