Title: Subquery Alias causing panic · Issue #153 · sqlc-dev/sqlc · GitHub
Open Graph Title: Subquery Alias causing panic · Issue #153 · sqlc-dev/sqlc
X Title: Subquery Alias causing panic · Issue #153 · sqlc-dev/sqlc
Description: I tried to do a more efficient distinct query (the second query) and noticed that the generation panics on the alias of a subquery. The first query shows a simpler example on how to cause this issue. panic: walk: unexpected node type *pg...
Open Graph Description: I tried to do a more efficient distinct query (the second query) and noticed that the generation panics on the alias of a subquery. The first query shows a simpler example on how to cause this issu...
X Description: I tried to do a more efficient distinct query (the second query) and noticed that the generation panics on the alias of a subquery. The first query shows a simpler example on how to cause this issu...
Opengraph URL: https://github.com/sqlc-dev/sqlc/issues/153
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Subquery Alias causing panic","articleBody":"I tried to do a more efficient distinct query (the second query) and noticed that the generation panics on the alias of a subquery. The first query shows a simpler example on how to cause this issue.\r\n\r\n```\r\npanic: walk: unexpected node type *pg_query.Alias\r\n```\r\n\r\n```sql\r\n-- schema.sql\r\nCREATE TABLE authors (\r\n id BIGSERIAL PRIMARY KEY,\r\n name TEXT NOT NULL,\r\n bio TEXT\r\n);\r\n```\r\n\r\n```sql\r\n-- name: SubAuthors :many\r\nSELECT sub.name FROM (SELECT * FROM authors) sub\r\n\r\n-- name: ListDistinctAuthors :many\r\nWITH RECURSIVE temp (t) AS (\r\n (SELECT name from authors LIMIT 1)\r\n UNION ALL\r\n (SELECT name FROM temp, LATERAL (SELECT name FROM authors where name \u003e t LIMIT 1) sub)\r\n)\r\nSELECT t from temp;\r\n```","author":{"url":"https://github.com/arddor","@type":"Person","name":"arddor"},"datePublished":"2019-12-12T10:00:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/153/sqlc/issues/153"}
| 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:93887509-2ceb-302e-a4c8-49f186c12643 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B6CE:28B620:5C777:79AA9:6A524A42 |
| html-safe-nonce | a6befd426be80a48a145b5571e89fc1911ebfb8e9fc4aea304bea9779e2b8c7c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNkNFOjI4QjYyMDo1Qzc3Nzo3OUFBOTo2QTUyNEE0MiIsInZpc2l0b3JfaWQiOiIzOTMwNTU3OTcxNDY2MTc3MDkwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0a54b283906d8a738b9423234e8b0f81261c06316366b5d63b172094c27fb77a |
| hovercard-subject-tag | issue:536873547 |
| 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/153/issue_layout |
| twitter:image | https://opengraph.githubassets.com/49a09438d2e6f0b94a2cd32eb66fdd5a161ee7c2ef9a4b350f62bc12f9f1ea98/sqlc-dev/sqlc/issues/153 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/49a09438d2e6f0b94a2cd32eb66fdd5a161ee7c2ef9a4b350f62bc12f9f1ea98/sqlc-dev/sqlc/issues/153 |
| og:image:alt | I tried to do a more efficient distinct query (the second query) and noticed that the generation panics on the alias of a subquery. The first query shows a simpler example on how to cause this issu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | arddor |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width