Title: Nested WITH doesn't work · Issue #2226 · sqlc-dev/sqlc · GitHub
Open Graph Title: Nested WITH doesn't work · Issue #2226 · sqlc-dev/sqlc
X Title: Nested WITH doesn't work · Issue #2226 · sqlc-dev/sqlc
Description: Version 1.17.2 What happened? When a WITH is nested it doesn't work. The query works when running the query directly against postgres but fails when running in SQLC. Relevant log output /query.sql:9:1: relation "summary" does not exist D...
Open Graph Description: Version 1.17.2 What happened? When a WITH is nested it doesn't work. The query works when running the query directly against postgres but fails when running in SQLC. Relevant log output /query.sql:...
X Description: Version 1.17.2 What happened? When a WITH is nested it doesn't work. The query works when running the query directly against postgres but fails when running in SQLC. Relevant log output /query....
Opengraph URL: https://github.com/sqlc-dev/sqlc/issues/2226
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Nested WITH doesn't work","articleBody":"### Version\n\n1.17.2\n\n### What happened?\n\nWhen a WITH is nested it doesn't work. The query works when running the query directly against postgres but fails when running in SQLC.\n\n### Relevant log output\n\n```shell\n/query.sql:9:1: relation \"summary\" does not exist\n```\n\n\n### Database schema\n\n```sql\n-- Example queries for sqlc\r\nCREATE TABLE authors (\r\n id BIGSERIAL PRIMARY KEY,\r\n name text NOT NULL,\r\n bio text\r\n);\n```\n\n\n### SQL queries\n\n```sql\n-- name: GetAuthor :one\r\nWITH person AS(\r\n WITH summary AS(\r\n WITH mb AS(\r\n select\r\n *\r\n from authors\r\n )\r\n SELECT\r\n bio\r\n FROM mb\r\n )\r\n SELECT\r\n count(*)\r\n FROM summary\r\n)\r\n\r\nselect * from person;\n```\n\n\n### Configuration\n\n_No response_\n\n### Playground URL\n\nhttps://play.sqlc.dev/p/e3b1e1370d95e38ad655fb46b019f20172272b6298e112ee9bf770878979bd00\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/hugosjoberg","@type":"Person","name":"hugosjoberg"},"datePublished":"2023-04-23T19:16:14.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/2226/sqlc/issues/2226"}
| 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:7543715e-60d9-e3ea-c6f0-da8d781b76f5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9D36:2DE151:85346E:B37EC3:6A515796 |
| html-safe-nonce | 337dcb43baaf21866112a29c4b321df2769d8a31474b8e4a3729f1ce9e73ed03 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RDM2OjJERTE1MTo4NTM0NkU6QjM3RUMzOjZBNTE1Nzk2IiwidmlzaXRvcl9pZCI6Ijc0NzkxODU1MTA0OTUyNDYyMzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6434d50c205d438fa237be4e211c8200e03020ee56be23f287bc8322f3f73de0 |
| hovercard-subject-tag | issue:1680136511 |
| 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/2226/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ca3afb5cf859897a0b78affb2ee77f350e51684b2c0311cbc047a5e60b96e2b0/sqlc-dev/sqlc/issues/2226 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ca3afb5cf859897a0b78affb2ee77f350e51684b2c0311cbc047a5e60b96e2b0/sqlc-dev/sqlc/issues/2226 |
| og:image:alt | Version 1.17.2 What happened? When a WITH is nested it doesn't work. The query works when running the query directly against postgres but fails when running in SQLC. Relevant log output /query.sql:... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hugosjoberg |
| 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