Closed
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
Database schema
-- Example queries for sqlc
CREATE TABLE authors (
id BIGSERIAL PRIMARY KEY,
name text NOT NULL,
bio text
);
SQL queries
-- name: GetAuthor :one
WITH person AS(
WITH summary AS(
WITH mb AS(
select
*
from authors
)
SELECT
bio
FROM mb
)
SELECT
count(*)
FROM summary
)
select * from person;
Configuration
No response
Playground URL
https://play.sqlc.dev/p/e3b1e1370d95e38ad655fb46b019f20172272b6298e112ee9bf770878979bd00
What operating system are you using?
Linux
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go