Title: CTE with RECURSIVE and UNION ALL · Issue #1912 · sqlc-dev/sqlc · GitHub
Open Graph Title: CTE with RECURSIVE and UNION ALL · Issue #1912 · sqlc-dev/sqlc
X Title: CTE with RECURSIVE and UNION ALL · Issue #1912 · sqlc-dev/sqlc
Description: Version 1.15.0 What happened? I try to generate go code with a recursive CTE, which uses UNION ALL and it fails. My query is quite complex, but here is a simple reproduction: Relevant log output query.sql:7:8: column "n" does not exist D...
Open Graph Description: Version 1.15.0 What happened? I try to generate go code with a recursive CTE, which uses UNION ALL and it fails. My query is quite complex, but here is a simple reproduction: Relevant log output qu...
X Description: Version 1.15.0 What happened? I try to generate go code with a recursive CTE, which uses UNION ALL and it fails. My query is quite complex, but here is a simple reproduction: Relevant log output qu...
Opengraph URL: https://github.com/sqlc-dev/sqlc/issues/1912
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"CTE with RECURSIVE and UNION ALL","articleBody":"### Version\r\n\r\n1.15.0\r\n\r\n### What happened?\r\n\r\nI try to generate go code with a recursive CTE, which uses `UNION ALL` and it fails.\r\n\r\nMy query is quite complex, but here is a simple reproduction:\r\n\r\n\r\n### Relevant log output\r\n\r\n```shell\r\nquery.sql:7:8: column \"n\" does not exist\r\n```\r\n\r\n\r\n### Database schema\r\n\r\n_None_\r\n\r\n### SQL queries\r\n\r\n```sql\r\n-- name: CTERecursive :many\r\nWITH RECURSIVE t(n) AS (\r\n VALUES (1)\r\n UNION ALL\r\n SELECT n+1 FROM t WHERE n \u003c 100\r\n)\r\nSELECT n FROM t;\r\n```\r\n\r\n\r\n### Configuration\r\n\r\n```yaml\r\n{\r\n \"version\": \"1\",\r\n \"packages\": [\r\n {\r\n \"path\": \"go\",\r\n \"name\": \"querytest\",\r\n \"schema\": \"query.sql\",\r\n \"queries\": \"query.sql\"\r\n }\r\n ]\r\n}\r\n```\r\n\r\n\r\n### Playground URL\r\n\r\nhttps://play.sqlc.dev/p/5c0c86493af9912a8d54ab083a92edcd4105ea8baf30681e1abe761a0cce1246\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/oliverpool","@type":"Person","name":"oliverpool"},"datePublished":"2022-10-26T16:06:53.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/1912/sqlc/issues/1912"}
| 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:dd2cdef3-cb3e-f851-cf10-4d13c605ca59 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9E0E:BDE76:29713E8:38F428D:6A5056D9 |
| html-safe-nonce | f12bcdf5c3de2a6d1b30e204eb2b462e0546c7eb77b153a5d3b5959a19f965a0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTBFOkJERTc2OjI5NzEzRTg6MzhGNDI4RDo2QTUwNTZEOSIsInZpc2l0b3JfaWQiOiI3NjMwMzI1MjYzNjEyNTMyNDQxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e62ea3e9fbaf082e893db654be5145b4aa4053d50ba1a897e708608192e97905 |
| hovercard-subject-tag | issue:1424311181 |
| 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/1912/issue_layout |
| twitter:image | https://opengraph.githubassets.com/574a5521343f189439c7620ec7dcdcb292166af63e2cf3d066bb9fe6fc74601f/sqlc-dev/sqlc/issues/1912 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/574a5521343f189439c7620ec7dcdcb292166af63e2cf3d066bb9fe6fc74601f/sqlc-dev/sqlc/issues/1912 |
| og:image:alt | Version 1.15.0 What happened? I try to generate go code with a recursive CTE, which uses UNION ALL and it fails. My query is quite complex, but here is a simple reproduction: Relevant log output qu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | oliverpool |
| 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