-
Notifications
You must be signed in to change notification settings - Fork 901
Closed
simonklee/sqlc
#1Labels
bugSomething isn't workingSomething isn't workingtriageNew issues that hasn't been reviewedNew issues that hasn't been reviewed
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 SERIAL NOT NULL PRIMARY KEY
);
SQL queries
-- name: CTERef :one
WITH t1_ids AS (
SELECT id FROM t1
)
SELECT * FROM t1_ids WHERE t1_ids.id = sqlc.arg('id');
Configuration
{
"version": "2",
"sql": [{
"schema": "schema.sql",
"queries": "query.sql",
"engine": "postgresql",
"gen": {
"go": {
"out": "db"
}
}
}]
}
Playground URL
https://play.sqlc.dev/p/9048b486f822c300301650867612e42bef8f8d512dfd12d84ad3a4cd210f4ef7
What operating system are you using?
Linux
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go
seanlaff, ConradKurth and aryan-jain
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingtriageNew issues that hasn't been reviewedNew issues that hasn't been reviewed